diff options
author | Just van Rossum <just@letterror.com> | 2003-03-03 17:32:15 (GMT) |
---|---|---|
committer | Just van Rossum <just@letterror.com> | 2003-03-03 17:32:15 (GMT) |
commit | 96b1c903f5310202a665e86e624a38ede50429c3 (patch) | |
tree | 3b0aa4f39af59706f7728442c5abd18e9f8d7d8c /Misc | |
parent | ed6000a993b5648bce306988e327bdf95c5129d5 (diff) | |
download | cpython-96b1c903f5310202a665e86e624a38ede50429c3.zip cpython-96b1c903f5310202a665e86e624a38ede50429c3.tar.gz cpython-96b1c903f5310202a665e86e624a38ede50429c3.tar.bz2 |
Patch #683592 revisited, after discussions with MvL:
- Implement the behavior as specified in PEP 277, meaning os.listdir()
will only return unicode strings if it is _called_ with a unicode
argument.
- And then return only unicode, don't attempt to convert to ASCII.
- Don't switch on Py_FileSystemDefaultEncoding, but simply use the
default encoding if Py_FileSystemDefaultEncoding is NULL. This means
os.listdir() can now raise UnicodeDecodeError if the default encoding
can't represent the directory entry. (This seems better than silcencing
the error and fall back to a byte string.)
- Attempted to decribe the above in Doc/lib/libos.tex.
- Reworded the Misc/NEWS items to reflect the current situation.
This checkin also fixes bug #696261, which was due to os.listdir() not
using Py_FileSystemDefaultEncoding, like all file system calls are
supposed to.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -41,11 +41,9 @@ Library about the rationale is in the NEWS entry for that. See also SF bug report <http://www.python.org/sf/693121>. -- os.listdir() now returns Unicode strings on platforms that set - Py_FileSystemDefaultEncoding, for file names that are not representable - in ASCII. (This currently only affects MacOS X; on Windows versions - with wide file name support os.listdir() already returned Unicode - strings.) +- On Unix platforms, if os.listdir() is called with a Unicode argument, + it now returns Unicode strings. (This behavior was added earlier + to the Windows NT/2k/XP version of os.listdir().) - Distutils: both 'py_modules' and 'packages' keywords can now be specified in core.setup(). Previously you could supply one or the other, but @@ -88,8 +86,8 @@ TBD Mac --- -- os.listdir() now may return Unicode strings on MacOS X. See the general - news item under "Library". +- os.listdir() now returns Unicode strings on MacOS X when called with + a Unicode argument. See the general news item under "Library". - A new method MacOS.WMAvailable() returns true if it is safe to access the window manager, false otherwise. |