non-english filenames broken on Windows after r10693

2 views
Skip to first unread message

Václav Řehák

unread,
Feb 17, 2010, 5:43:21 AM2/17/10
to Django developers
Hi all,

the changeset 10693 fixing #11030 (File uploads break on non english
filesystem encoding) introduced a problem with non english filenames
in my setup (Windows XP or 2003, Python2.6, Apache). If I upload a
file with czech characters (e.g. čeština.txt - the first character is
ccaron or \u010d, the 3rd is scaron or \u0161) the file created on
Windows filesystem has a crippled name (čeština.txt).

The problem is caused by smart_str converting the unicode string into
bytestring. If I revert 10693 and let the filename be passed to
os.open() as unicode string, the file is correctly created on the
filesystem. I think that smart_str should be called only if the
underlying filesystem cannot handle unicode characters in the
filename.

Thanks,
Vaclav

Karen Tracey

unread,
Feb 17, 2010, 4:07:06 PM2/17/10
to django-d...@googlegroups.com
2010/2/17 Václav Řehák <reha...@gmail.com>

Please open a ticket. That fix looks wrong to me. We shouldn't be assuming the file system uses utf-8 encoding.

Karen

Václav Řehák

unread,
Feb 17, 2010, 4:47:06 PM2/17/10
to Django developers
On 17 ún, 22:07, Karen Tracey <kmtra...@gmail.com> wrote:
> 2010/2/17 Václav Řehák <rehak...@gmail.com>

Filed as #12898.

Reply all
Reply to author
Forward
0 new messages