STINNER Victor <victor.stin...@haypocalc.com> added the comment:

Patch:
 - Remove the bytes version of listdir(): reuse the unicode version but 
converts the filename to bytes using PyUnicode_EncodeFSDefault() if the 
directory name is not unicode
 - use Py_XDECREF(d) instead of Py_DECREF(d) at the end (because d=NULL on 
error)
 - use Py_CLEAR(d) instead of "Py_DECREF(d); d=NULL;"
 - remove "char namebuf[MAX_PATH+5]" buffer (use less stack memory)

----------
keywords: +patch
Added file: http://bugs.python.org/file18836/listdir_windows_bytes.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9820>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to