jeudi 8 mai 2014

WeasyPrint : Type str doesn't support the buffer API

Under Windows, if you type weasyprint http://www.google.com test.pdf and get this message : 
 File "C:\Python34\lib\site-packages\weasyprint\__init__.py", line 293, in _select_source 
    base_url = path2url(filename) 
  File "C:\Python34\lib\site-packages\weasyprint\urls.py", line 87, in path2url 
    path = pathname2url(path) 
  File "C:\Python34\lib\nturl2path.py", line 46, in pathname2url 
    if not ':' in p: 
TypeError: Type str doesn't support the buffer API

You must edit C:\PythonXX\Lib\site-packages\weasyprint\urls.py and comment these lines :
    if isinstance(path, unicode): 
        path = path.encode(FILESYSTEM_ENCODING)

Aucun commentaire:

Categories