[issue10600] surrogateescape'd paths not readable on Windows XP.

2010-12-01 Thread Martin v . Löwis
Martin v. Löwis added the comment: This is not a bug. You can't expect that using an arbitrary codec (such as UTF-8) with the surrogateescape code, and expect to be able that opening the file will be able to produce the correct filename. This won't work on Unix, in the general case, either. T

[issue10600] surrogateescape'd paths not readable on Windows XP.

2010-12-01 Thread Campbell Barton
Campbell Barton added the comment: This bug is with blender3d, were the paths are stored internally in C as simple char arrays - bytes. We could expose all path names as bytes too through our C/python API, this would at least be a 1:1 mapping, however Id prefer using strings if possible. Sin

[issue10600] surrogateescape'd paths not readable on Windows XP.

2010-12-01 Thread STINNER Victor
STINNER Victor added the comment: Use surrogateescape error handler to decode a Windows path is not a good idea. On Windows, the problem is not to decode a path (ANSI => wide char), but to encode a path (wide char => ANSI) to use a function expecting bytes path encoded to the ANSI code page.

[issue10600] surrogateescape'd paths not readable on Windows XP.

2010-12-01 Thread Campbell Barton
Campbell Barton added the comment: note, this bug was reported to me by a user running windows 7, 64bits. -- ___ Python tracker ___ _

[issue10600] surrogateescape'd paths not readable on Windows XP.

2010-12-01 Thread Campbell Barton
New submission from Campbell Barton : Attached is a script which works in linux but not windows XP 32bit with Python 3.1.3. The problem is that the path can be written to when specified as bytes but when escaped it fails. -- components: IO files: utf8_surrogateescape.py messages: 1230