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
fdf4a274
Kaydet (Commit)
fdf4a274
authored
Agu 11, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles.
üst
49281076
f6c7a859
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
pickletester.py
Lib/test/pickletester.py
+13
-0
NEWS
Misc/NEWS
+3
-0
_pickle.c
Modules/_pickle.c
+1
-2
No files found.
Lib/test/pickletester.py
Dosyayı görüntüle @
fdf4a274
...
@@ -1438,6 +1438,19 @@ class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
...
@@ -1438,6 +1438,19 @@ class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
def
test_multiple_unpicklings_unseekable
(
self
):
def
test_multiple_unpicklings_unseekable
(
self
):
self
.
_check_multiple_unpicklings
(
UnseekableIO
)
self
.
_check_multiple_unpicklings
(
UnseekableIO
)
def
test_unpickling_buffering_readline
(
self
):
# Issue #12687: the unpickler's buffering logic could fail with
# text mode opcodes.
data
=
list
(
range
(
10
))
for
proto
in
protocols
:
for
buf_size
in
range
(
1
,
11
):
f
=
io
.
BufferedRandom
(
io
.
BytesIO
(),
buffer_size
=
buf_size
)
pickler
=
self
.
pickler_class
(
f
,
protocol
=
proto
)
pickler
.
dump
(
data
)
f
.
seek
(
0
)
unpickler
=
self
.
unpickler_class
(
f
)
self
.
assertEqual
(
unpickler
.
load
(),
data
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# Print some stuff that can be used to rewrite DATA{0,1,2}
# Print some stuff that can be used to rewrite DATA{0,1,2}
...
...
Misc/NEWS
Dosyayı görüntüle @
fdf4a274
...
@@ -251,6 +251,9 @@ Core and Builtins
...
@@ -251,6 +251,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #12687: Fix a possible buffering bug when unpickling text mode
(protocol 0, mostly) pickles.
- Issue #10087: Fix the html output format of the calendar module.
- Issue #10087: Fix the html output format of the calendar module.
- Issue #12540: Prevent zombie IDLE processes on Windows due to changes
- Issue #12540: Prevent zombie IDLE processes on Windows due to changes
...
...
Modules/_pickle.c
Dosyayı görüntüle @
fdf4a274
...
@@ -1034,9 +1034,8 @@ _Unpickler_Readline(UnpicklerObject *self, char **result)
...
@@ -1034,9 +1034,8 @@ _Unpickler_Readline(UnpicklerObject *self, char **result)
num_read
=
_Unpickler_ReadFromFile
(
self
,
READ_WHOLE_LINE
);
num_read
=
_Unpickler_ReadFromFile
(
self
,
READ_WHOLE_LINE
);
if
(
num_read
<
0
)
if
(
num_read
<
0
)
return
-
1
;
return
-
1
;
*
result
=
self
->
input_buffer
;
self
->
next_read_idx
=
num_read
;
self
->
next_read_idx
=
num_read
;
return
num_read
;
return
_Unpickler_CopyLine
(
self
,
self
->
input_buffer
,
num_read
,
result
)
;
}
}
/* If we get here, we've run off the end of the input string. Return the
/* If we get here, we've run off the end of the input string. Return the
...
...
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