[reportlab-users] problem running runAll.py tests when path contains non ascii characters

rejoc rejoc at free.fr
Thu May 31 04:26:32 EDT 2007


Hello,

I've just installed ReportLab on a windows XP PC and got the following
errors when running runAll.py :

======================================================================
ERROR: Make a PDFgen document with most graphics features
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\users\jolin_r\Mes documents\Mes
tÚlÚchargements\Firefox\reportlab_2_1\reportlab\test\test_pdfgen_callback.py",
line 27, in test0
makeDocument(outputfile('test_pdfgen_callback.pdf'),
pageCallBack=self.callMe)
File
"C:\Python24\Lib\site-packages\reportlab\test\test_pdfgen_general.py",
line 784, in makeDocument
r1 = (inch, 1.5*inch, inch+2*3+c.stringWidth(link,c._fontname,
c._fontsize), 1.75*inch) # this is x1,y1,x2,y2
File "C:\Python24\Lib\site-packages\reportlab\pdfgen\canvas.py", line
1316, in stringWidth
(fontSize,self._fontsize)[fontSize is None])
File "_rl_accel.c", line 1102, in stringWidthU
File "_rl_accel.c", line 1149, in _instanceStringWidthU
File "C:\Python24\Lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 49-51:
invalid data

======================================================================
ERROR: Make a PDFgen document with most graphics features
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\users\jolin_r\Mes documents\Mes
tÚlÚchargements\Firefox\reportlab_2_1\reportlab\test\test_pdfgen_general.py",
line 833, in test0
run(outputfile('test_pdfgen_general.pdf'))
File "D:\users\jolin_r\Mes documents\Mes
tÚlÚchargements\Firefox\reportlab_2_1\reportlab\test\test_pdfgen_general.py",
line 796, in run
c = makeDocument(filename)
File "D:\users\jolin_r\Mes documents\Mes
tÚlÚchargements\Firefox\reportlab_2_1\reportlab\test\test_pdfgen_general.py",
line 784, in makeDocument
r1 = (inch, 1.5*inch, inch+2*3+c.stringWidth(link,c._fontname,
c._fontsize), 1.75*inch) # this is x1,y1,x2,y2
File "C:\Python24\Lib\site-packages\reportlab\pdfgen\canvas.py", line
1316, in stringWidth
(fontSize,self._fontsize)[fontSize is None])
File "_rl_accel.c", line 1102, in stringWidthU
File "_rl_accel.c", line 1149, in _instanceStringWidthU
File "C:\Python24\Lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 49-51:
invalid data

----------------------------------------------------------------------
Ran 171 tests in 73.688s


the directory path is actually .....\Mes documents\Mes
Téléchargements\Firefox\...

I then moved the reportlab directory to another place with no non ascii
character in the path and the tests went ok.



More information about the reportlab-users mailing list