Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
21d7533c
Commit
21d7533c
authored
Jan 26, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23094: Fixed readline with frames in Python implementation of pickle.
parent
5106d044
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Lib/pickle.py
Lib/pickle.py
+1
-1
Lib/test/pickletester.py
Lib/test/pickletester.py
+8
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/pickle.py
View file @
21d7533c
...
...
@@ -242,7 +242,7 @@ class _Unframer:
if
not
data
:
self
.
current_frame
=
None
return
self
.
file_readline
()
if
data
[
-
1
]
!=
b'
\
n
'
:
if
data
[
-
1
]
!=
b'
\
n
'
[
0
]
:
raise
UnpicklingError
(
"pickle exhausted before end of frame"
)
return
data
...
...
Lib/test/pickletester.py
View file @
21d7533c
...
...
@@ -1538,6 +1538,14 @@ class AbstractPickleTests(unittest.TestCase):
count_opcode
(
pickle
.
FRAME
,
pickled
))
self
.
assertEqual
(
obj
,
self
.
loads
(
some_frames_pickle
))
def
test_frame_readline
(
self
):
pickled
=
b'
\
x80
\
x04
\
x95
\
x05
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
I42
\
n
.'
# 0: \x80 PROTO 4
# 2: \x95 FRAME 5
# 11: I INT 42
# 15: . STOP
self
.
assertEqual
(
self
.
loads
(
pickled
),
42
)
def
test_nested_names
(
self
):
global
Nested
class
Nested
:
...
...
Misc/NEWS
View file @
21d7533c
...
...
@@ -50,6 +50,8 @@ Core and Builtins
Library
-------
- Issue #23094: Fixed readline with frames in Python implementation of pickle.
- Issue #23268: Fixed bugs in the comparison of ipaddress classes.
- Issue #21408: Removed incorrect implementations of __ne__() which didn'
t
...
...
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