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
6b95f1d9
Kaydet (Commit)
6b95f1d9
authored
Haz 03, 2005
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
üst
6d6917be
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 @
6b95f1d9
...
...
@@ -235,6 +235,16 @@ class BZ2FileTest(BaseTest):
# "Test opening a nonexistent file"
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
):
def
testCompress
(
self
):
# "Test BZ2Compressor.compress()/flush()"
...
...
Misc/NEWS
Dosyayı görüntüle @
6b95f1d9
...
...
@@ -91,6 +91,8 @@ Core and builtins
Extension Modules
-----------------
- Bug #1194181: bz2.BZ2File didn'
t
handle
mode
'U'
correctly
.
-
Patch
#
1212117
:
os
.
stat
().
st_flags
is
now
accessible
as
a
attribute
if
available
on
the
platform
.
...
...
Modules/bz2module.c
Dosyayı görüntüle @
6b95f1d9
...
...
@@ -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)"
,
...
...
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