piranna / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

UnicodeDecodeError when getting unicode representation of FSError containing non-ASCII characters #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>>> from fs.errors import PathError
>>> pe = PathError(r'/Users/ppotrebic/FrødøShïrê')
>>> unicode(pe)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ppotrebic/.virtualenvs/sync/lib/python2.7/site-packages/fs/errors.py", line 62, in __unicode__
    return unicode(self.msg) % self.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: 
ordinal not in range(128)

See discussion at 
https://groups.google.com/forum/#!searchin/pyfilesystem-discussion/peter/pyfiles
ystem-discussion/4Rv3_-wU0QE/IfvZG-JVMMUJ.

Original issue reported on code.google.com by kunalpar...@gmail.com on 12 Jul 2013 at 5:45

GoogleCodeExporter commented 9 years ago
Fix attached.

Original comment by kunalpar...@gmail.com on 12 Jul 2013 at 5:50

Attachments:

GoogleCodeExporter commented 9 years ago
Can you reproduce this issue with the latests code from SVN?

Original comment by willmcgugan on 12 Jul 2013 at 8:47

GoogleCodeExporter commented 9 years ago
Yes, it repros.

Original comment by kunalpar...@gmail.com on 12 Jul 2013 at 3:36

GoogleCodeExporter commented 9 years ago

Original comment by willmcgugan on 10 Sep 2013 at 8:50