mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
This commit is contained in:
parent
6d6917be00
commit
6b95f1d963
3 changed files with 16 additions and 0 deletions
|
@ -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)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue