STINNER Victor <[EMAIL PROTECTED]> added the comment:

Le Tuesday 07 October 2008 01:13:22 Martin v. Löwis, vous avez écrit :
> IIUC, these fixes are still not complete: they lack documentation
> changes. (...) Of course, it would have been better if the original patches 
> already contained the necessary documentation and test suite changes.

Most (or all) patches include new tests about bytes. Here is a patch for 
os.rst documentation about listdir(), getcwdb() and readlink().

> See msg74271 for what Guido considers the lacking documentation;
> you may find that other aspects also need documentation.

I wrote a long document about bytes for filenames but not only. I'm still 
waiting for some contributors or reviewers:
http://wiki.python.org/moin/Python3UnicodeDecodeError

> As for test cases: it seems that those got waived, in the hurry.

Can you be more precise? Which tests have to be improved/rewritten?

Added file: http://bugs.python.org/file11721/library_os_doc.patch

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3187>
_______________________________________
Index: Doc/library/os.rst
===================================================================
--- Doc/library/os.rst  (révision 66821)
+++ Doc/library/os.rst  (copie de travail)
@@ -693,13 +693,13 @@
 
 .. function:: getcwd()
 
-   Return a bytestring representing the current working directory.
+   Return a string representing the current working directory.
    Availability: Unix, Windows.
 
 
-.. function:: getcwdu()
+.. function:: getcwdb()
 
-   Return a string representing the current working directory.
+   Return a bytestring  representing the current working directory.
    Availability: Unix, Windows.
 
 
@@ -801,8 +801,10 @@
    ``'..'`` even if they are present in the directory. Availability:
    Unix, Windows.
 
-   On Windows NT/2k/XP and Unix, if *path* is a Unicode object, the result 
will be
-   a list of Unicode objects.
+   If *path* is a Unicode object, the result will be a list of Unicode objects.
+   If a filename can not be decoded to unicode, it is skipped. If *path* is a
+   bytes string, the result will be list of bytes objects included files
+   skipped by the unicode version.
 
 
 .. function:: lstat(path)
@@ -916,7 +918,9 @@
    be converted to an absolute pathname using 
``os.path.join(os.path.dirname(path),
    result)``.
 
-   If the *path* is a Unicode object, the result will also be a Unicode object.
+   If the *path* is an Unicode object, the result will also be a Unicode object
+   and may raise an UnicodeDecodeError. If the *path* is a bytes object, the
+   result will be a bytes object.
 
    Availability: Unix.
 
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to