Won't delete files with accents (or other unicode characters)
|Reported by:||typeshige||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I did some searches and didn't find it. I have a model with an ImageField. When I try to delete, it fails whenever the filename has accents. I'm using Linux.
/home/django/.virtualenvs/astrobiology/lib/python2.6/site-packages/django/core/files/storage.pyc in delete(self, name)
190 name = self.path(name)
191 # If the file exists, delete it from the filesystem.
--> 192 if os.path.exists(name):
/home/django/.virtualenvs/astrobiology/lib/python2.6/genericpath.pyc in exists(path)
16 """Test whether a path exists. Returns False for broken symbolic links"""
---> 18 st = os.stat(path)
19 except os.error:
20 return False
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 103: ordinal not in range(128)