summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-06-03 19:47:00 (GMT)
committerGeorg Brandl <georg@python.org>2005-06-03 19:47:00 (GMT)
commit6b95f1d963d3fd2dcc2e84e83b514364e9f52006 (patch)
tree05fb825d6c8a3b148cd9462b7ab31d003de269d9 /Modules
parent6d6917be00942734fc8665a2398bd06087115729 (diff)
downloadcpython-6b95f1d963d3fd2dcc2e84e83b514364e9f52006.zip
cpython-6b95f1d963d3fd2dcc2e84e83b514364e9f52006.tar.gz
cpython-6b95f1d963d3fd2dcc2e84e83b514364e9f52006.tar.bz2
Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/bz2module.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 8a93cd9..b9874eb 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1308,6 +1308,10 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
break;
}
+ if (mode_char == 0) {
+ mode_char = 'r';
+ }
+
mode = (mode_char == 'r') ? "rb" : "wb";
self->file = PyObject_CallFunction((PyObject*)&PyFile_Type, "(Osi)",