Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
bf077106
Kaydet (Commit)
bf077106
authored
Haz 03, 2005
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backport bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
üst
c5d8c7bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
test_bz2.py
Lib/test/test_bz2.py
+10
-0
NEWS
Misc/NEWS
+2
-0
bz2module.c
Modules/bz2module.c
+4
-0
No files found.
Lib/test/test_bz2.py
Dosyayı görüntüle @
bf077106
...
@@ -235,6 +235,16 @@ class BZ2FileTest(BaseTest):
...
@@ -235,6 +235,16 @@ class BZ2FileTest(BaseTest):
# "Test opening a nonexistent file"
# "Test opening a nonexistent file"
self
.
assertRaises
(
IOError
,
BZ2File
,
"/non/existent"
)
self
.
assertRaises
(
IOError
,
BZ2File
,
"/non/existent"
)
def
testModeU
(
self
):
# Bug #1194181: bz2.BZ2File opened for write with mode "U"
self
.
createTempFile
()
bz2f
=
BZ2File
(
self
.
filename
,
"U"
)
bz2f
.
close
()
f
=
file
(
self
.
filename
)
f
.
seek
(
0
,
2
)
self
.
assertEqual
(
f
.
tell
(),
len
(
self
.
DATA
))
f
.
close
()
class
BZ2CompressorTest
(
BaseTest
):
class
BZ2CompressorTest
(
BaseTest
):
def
testCompress
(
self
):
def
testCompress
(
self
):
# "Test BZ2Compressor.compress()/flush()"
# "Test BZ2Compressor.compress()/flush()"
...
...
Misc/NEWS
Dosyayı görüntüle @
bf077106
...
@@ -27,6 +27,8 @@ Core and builtins
...
@@ -27,6 +27,8 @@ Core and builtins
Extension Modules
Extension Modules
-----------------
-----------------
- Bug #1194181: bz2.BZ2File didn'
t
handle
mode
'U'
correctly
.
-
Bug
#
1166660
:
The
readline
module
could
segfault
if
hook
functions
-
Bug
#
1166660
:
The
readline
module
could
segfault
if
hook
functions
were
set
in
a
different
thread
than
that
which
called
readline
.
were
set
in
a
different
thread
than
that
which
called
readline
.
...
...
Modules/bz2module.c
Dosyayı görüntüle @
bf077106
...
@@ -1308,6 +1308,10 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
...
@@ -1308,6 +1308,10 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
break
;
break
;
}
}
if
(
mode_char
==
0
)
{
mode_char
=
'r'
;
}
mode
=
(
mode_char
==
'r'
)
?
"rb"
:
"wb"
;
mode
=
(
mode_char
==
'r'
)
?
"rb"
:
"wb"
;
self
->
file
=
PyObject_CallFunction
((
PyObject
*
)
&
PyFile_Type
,
"(Osi)"
,
self
->
file
=
PyObject_CallFunction
((
PyObject
*
)
&
PyFile_Type
,
"(Osi)"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment