summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-03-03 17:32:15 (GMT)
committerJust van Rossum <just@letterror.com>2003-03-03 17:32:15 (GMT)
commit96b1c903f5310202a665e86e624a38ede50429c3 (patch)
tree3b0aa4f39af59706f7728442c5abd18e9f8d7d8c /Doc
parented6000a993b5648bce306988e327bdf95c5129d5 (diff)
downloadcpython-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 'Doc')
-rw-r--r--Doc/lib/libos.tex4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex
index b2c10f7..844704b 100644
--- a/Doc/lib/libos.tex
+++ b/Doc/lib/libos.tex
@@ -711,8 +711,8 @@ entries \code{'.'} and \code{'..'} even if they are present in the
directory.
Availability: Macintosh, \UNIX, Windows.
-\versionadded[On Windows NT/2k/XP, if \var{path} is a Unicode object,
-the result will be a list of Unicode objects.]{2.3}
+\versionadded[On Windows NT/2k/XP and Unix, if \var{path} is a Unicode
+object, the result will be a list of Unicode objects.]{2.3}
\end{funcdesc}
\begin{funcdesc}{lstat}{path}