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
3335a7ad
Kaydet (Commit)
3335a7ad
authored
Agu 14, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
üst
2463f8f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
test_bz2.py
Lib/test/test_bz2.py
+2
-0
NEWS
Misc/NEWS
+3
-0
bz2module.c
Modules/bz2module.c
+17
-2
No files found.
Lib/test/test_bz2.py
Dosyayı görüntüle @
3335a7ad
...
@@ -166,6 +166,8 @@ class BZ2FileTest(BaseTest):
...
@@ -166,6 +166,8 @@ class BZ2FileTest(BaseTest):
sio
=
StringIO
(
self
.
TEXT
)
sio
=
StringIO
(
self
.
TEXT
)
bz2f
.
writelines
(
sio
.
readlines
())
bz2f
.
writelines
(
sio
.
readlines
())
bz2f
.
close
()
bz2f
.
close
()
# patch #1535500
self
.
assertRaises
(
ValueError
,
bz2f
.
writelines
,
[
"a"
])
f
=
open
(
self
.
filename
,
'rb'
)
f
=
open
(
self
.
filename
,
'rb'
)
self
.
assertEqual
(
self
.
decompress
(
f
.
read
()),
self
.
TEXT
)
self
.
assertEqual
(
self
.
decompress
(
f
.
read
()),
self
.
TEXT
)
f
.
close
()
f
.
close
()
...
...
Misc/NEWS
Dosyayı görüntüle @
3335a7ad
...
@@ -79,6 +79,9 @@ Library
...
@@ -79,6 +79,9 @@ Library
Extension
Modules
Extension
Modules
-----------------
-----------------
-
Patch
#
1535500
:
fix
segfault
in
BZ2File
.
writelines
and
make
sure
it
raises
the
correct
exceptions
.
-
Patch
#
1536908
:
enable
building
ctypes
on
OpenBSD
/
AMD64
.
The
-
Patch
#
1536908
:
enable
building
ctypes
on
OpenBSD
/
AMD64
.
The
'-no-stack-protector'
compiler
flag
for
OpenBSD
has
been
removed
.
'-no-stack-protector'
compiler
flag
for
OpenBSD
has
been
removed
.
...
...
Modules/bz2module.c
Dosyayı görüntüle @
3335a7ad
...
@@ -812,12 +812,12 @@ BZ2File_write(BZ2FileObject *self, PyObject *args)
...
@@ -812,12 +812,12 @@ BZ2File_write(BZ2FileObject *self, PyObject *args)
case
MODE_CLOSED
:
case
MODE_CLOSED
:
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
"I/O operation on closed file"
);
"I/O operation on closed file"
);
goto
cleanup
;
;
goto
cleanup
;
default:
default:
PyErr_SetString
(
PyExc_IOError
,
PyErr_SetString
(
PyExc_IOError
,
"file is not ready for writing"
);
"file is not ready for writing"
);
goto
cleanup
;
;
goto
cleanup
;
}
}
self
->
f_softspace
=
0
;
self
->
f_softspace
=
0
;
...
@@ -861,6 +861,21 @@ BZ2File_writelines(BZ2FileObject *self, PyObject *seq)
...
@@ -861,6 +861,21 @@ BZ2File_writelines(BZ2FileObject *self, PyObject *seq)
int
bzerror
;
int
bzerror
;
ACQUIRE_LOCK
(
self
);
ACQUIRE_LOCK
(
self
);
switch
(
self
->
mode
)
{
case
MODE_WRITE
:
break
;
case
MODE_CLOSED
:
PyErr_SetString
(
PyExc_ValueError
,
"I/O operation on closed file"
);
goto
error
;
default:
PyErr_SetString
(
PyExc_IOError
,
"file is not ready for writing"
);
goto
error
;
}
islist
=
PyList_Check
(
seq
);
islist
=
PyList_Check
(
seq
);
if
(
!
islist
)
{
if
(
!
islist
)
{
iter
=
PyObject_GetIter
(
seq
);
iter
=
PyObject_GetIter
(
seq
);
...
...
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