On maandag, augustus 12, 2002, at 01:48 , Martin v. L=F6wis wrote: > http://www.python.org/peps/pep-0277.html > > The PEP describes a Windows-only change to Unicode in file names: On > Windows NT/2k/XP, Python would allow arbitrary Unicode strings as file > names and pass them to the OS, instead of converting them to CP_ACP > first. This applies to open() and all os functions that accept > filenames. > > In addition, os.list() would return Unicode filenames if the argument > is Unicode. This is the bit I still don't like (at least, if I'm not=20 mistaken I commented on it a while ago too). A routine could be=20 doing an os.list() expecting strings, but suddenly someone=20 passes it a unicode directoryname and the return value would=20 change. I would much prefer an optional encoding argument whereby you=20 give the encoding in which you want the return value. Default=20 would be the local filesystem encoding. If you pass unicode you=20 will get direct unicode on XP/2K, and a converted string on=20 other platforms (but always unicode). Oh yes, the same reasoning would hold for readlink(), getcwd()=20 and any other call that returns filenames. -- - Jack Jansen <Jack.Jansen@oratrix.com> =20 http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution --=20 Emma Goldman -
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4