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
65897a38
Kaydet (Commit)
65897a38
authored
Tem 02, 2011
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Closes #12291 for 3.3 - merged fix from 3.2.
üst
2ee61884
5bdae3bb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
test_file_loader.py
Lib/importlib/test/source/test_file_loader.py
+1
-1
test_marshal.py
Lib/test/test_marshal.py
+24
-0
NEWS
Misc/NEWS
+3
-0
marshal.c
Python/marshal.c
+0
-0
No files found.
Lib/importlib/test/source/test_file_loader.py
Dosyayı görüntüle @
65897a38
...
...
@@ -214,7 +214,7 @@ class BadBytecodeTest(unittest.TestCase):
lambda
bc
:
bc
[:
8
]
+
b
'<test>'
,
del_source
=
del_source
)
file_path
=
mapping
[
'_temp'
]
if
not
del_source
else
bytecode_path
with
self
.
assertRaises
(
Value
Error
):
with
self
.
assertRaises
(
EOF
Error
):
self
.
import_
(
file_path
,
'_temp'
)
def
_test_bad_magic
(
self
,
test
,
*
,
del_source
=
False
):
...
...
Lib/test/test_marshal.py
Dosyayı görüntüle @
65897a38
...
...
@@ -228,6 +228,30 @@ class BugsTestCase(unittest.TestCase):
invalid_string
=
b
'l
\x02\x00\x00\x00\x00\x00\x00\x00
'
self
.
assertRaises
(
ValueError
,
marshal
.
loads
,
invalid_string
)
def
test_multiple_dumps_and_loads
(
self
):
# Issue 12291: marshal.load() should be callable multiple times
# with interleaved data written by non-marshal code
# Adapted from a patch by Engelbert Gruber.
data
=
(
1
,
'abc'
,
b
'def'
,
1.0
,
(
2
,
'a'
,
[
'b'
,
b
'c'
]))
for
interleaved
in
(
b
''
,
b
'0123'
):
ilen
=
len
(
interleaved
)
positions
=
[]
try
:
with
open
(
support
.
TESTFN
,
'wb'
)
as
f
:
for
d
in
data
:
marshal
.
dump
(
d
,
f
)
if
ilen
:
f
.
write
(
interleaved
)
positions
.
append
(
f
.
tell
())
with
open
(
support
.
TESTFN
,
'rb'
)
as
f
:
for
i
,
d
in
enumerate
(
data
):
self
.
assertEqual
(
d
,
marshal
.
load
(
f
))
if
ilen
:
f
.
read
(
ilen
)
self
.
assertEqual
(
positions
[
i
],
f
.
tell
())
finally
:
support
.
unlink
(
support
.
TESTFN
)
def
test_main
():
support
.
run_unittest
(
IntTestCase
,
...
...
Misc/NEWS
Dosyayı görüntüle @
65897a38
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
- Issue #12291: You can now load multiple marshalled objects from a stream,
with other data interleaved between marshalled objects.
- Issue #12356: When required positional or keyword-only arguments are not
given, produce a informative error message which includes the name(s) of the
missing arguments.
...
...
Python/marshal.c
Dosyayı görüntüle @
65897a38
This diff is collapsed.
Click to expand it.
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