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
74c71f5a
Commit
74c71f5a
authored
May 26, 2008
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#2957: marshal recursion limit exceeded when importing a large .pyc file
parent
954aa943
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
Lib/test/test_marshal.py
Lib/test/test_marshal.py
+6
-0
Misc/NEWS
Misc/NEWS
+4
-0
Python/marshal.c
Python/marshal.c
+0
-2
No files found.
Lib/test/test_marshal.py
View file @
74c71f5a
...
...
@@ -113,6 +113,12 @@ class CodeTestCase(unittest.TestCase):
new
=
marshal
.
loads
(
marshal
.
dumps
(
co
))
self
.
assertEqual
(
co
,
new
)
def
test_many_codeobjects
(
self
):
# Issue2957: bad recursion count on code objects
count
=
5000
# more than MAX_MARSHAL_STACK_DEPTH
codes
=
(
ExceptionTestCase
.
test_exceptions
.
__code__
,)
*
count
marshal
.
loads
(
marshal
.
dumps
(
codes
))
class
ContainerTestCase
(
unittest
.
TestCase
,
HelperMixin
):
d
=
{
'astring'
:
'foo@bar.baz.spam'
,
'afloat'
:
7283.43
,
...
...
Misc/NEWS
View file @
74c71f5a
...
...
@@ -12,6 +12,10 @@ What's new in Python 3.0b1?
Core and Builtins
-----------------
- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
unmarshalling many code objects, which happens when importing a
large .pyc file (~1000 functions).
- Issue #2963: fix merging oversight that disabled method cache for
all types.
...
...
Python/marshal.c
View file @
74c71f5a
...
...
@@ -913,8 +913,6 @@ r_object(RFILE *p)
Py_XDECREF
(
filename
);
Py_XDECREF
(
name
);
Py_XDECREF
(
lnotab
);
return
v
;
}
retval
=
v
;
break
;
...
...
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