Le Mardi 25 Octobre 2011 09:09:56 vous avez écrit : > > I propose to raise Unicode errors if a filename cannot be decoded on > > Windows, instead of creating a bogus filenames with questions marks. > > Can you please elaborate what APIs you are talking about exactly?
Basically, all functions processing filenames, so most functions of posixmodule.c. Some examples: - os.listdir(): FindFirstFileA, FindNextFileA, FindCloseA - os.lstat(): CreateFileA - os.getcwdb(): getcwd() - os.mkdir(): CreateDirectoryA - os.chmod(): SetFileAttributesA - ... > If it's the byte APIs (i.e. using bytes as file names), then I'm -1 on > this proposal. People that explicitly use bytes for file names deserve > to get whatever exact platform semantics the platform has to offer. This > is true on Unix, and it is also true on Windows. My proposition is a fix to user reported by a user: http://bugs.python.org/issue13247 I want to keep the bytes API for backward compatibility, and it will still work for non-ASCII characters, but only for non-ASCII characters encodable to the ANSI code page. In practice, characters not encodable to the ANSI code page are very rare. For example: it's difficult to write such characters directly with the keyboard. I bet that very few people will notify the change. Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com