projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69700ef
)
os.listdir(): Fall back to the original byte string if conversion to unicode
author
Just van Rossum
<just@letterror.com>
Tue, 4 Mar 2003 19:30:44 +0000
(19:30 +0000)
committer
Just van Rossum
<just@letterror.com>
Tue, 4 Mar 2003 19:30:44 +0000
(19:30 +0000)
fails, as discussed in patch #683592.
Modules/posixmodule.c
patch
|
blob
|
history
diff --git
a/Modules/posixmodule.c
b/Modules/posixmodule.c
index cc922725d7fa08a35282bec0721fd830e516f579..713729a8af71c0fc7f7f5e10a2e6a8da4d50746c 100644
(file)
--- a/
Modules/posixmodule.c
+++ b/
Modules/posixmodule.c
@@
-1809,12
+1809,14
@@
posix_listdir(PyObject *self, PyObject *args)
w = PyUnicode_FromEncodedObject(v,
Py_FileSystemDefaultEncoding,
"strict");
- Py_DECREF(v);
- v = w;
- if (v == NULL) {
- Py_DECREF(d);
- d = NULL;
- break;
+ if (w != NULL) {
+ Py_DECREF(v);
+ v = w;
+ }
+ else {
+ /* fall back to the original byte string, as
+ discussed in patch #683592 */
+ PyErr_Clear();
}
}
#endif