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
7492e426
Commit
7492e426
authored
Mar 21, 2007
by
Žiga Seilnacht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1675967: re patterns pickled with older Python versions can
now be unpickled. Will backport.
parent
3ff9e558
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
Lib/sre.py
Lib/sre.py
+3
-0
Lib/test/test_re.py
Lib/test/test_re.py
+7
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/sre.py
View file @
7492e426
...
...
@@ -8,3 +8,6 @@ warnings.warn("The sre module is deprecated, please import re.",
from
re
import
*
from
re
import
__all__
# old pickles expect the _compile() reconstructor in this module
from
re
import
_compile
Lib/test/test_re.py
View file @
7492e426
import
sys
sys
.
path
=
[
'.'
]
+
sys
.
path
from
test.test_support
import
verbose
,
run_unittest
from
test.test_support
import
verbose
,
run_unittest
,
guard_warnings_filter
import
re
from
re
import
Scanner
import
sys
,
os
,
traceback
...
...
@@ -414,6 +414,12 @@ class ReTests(unittest.TestCase):
self.pickle_test(pickle)
import cPickle
self.pickle_test(cPickle)
# old pickles expect the _compile() reconstructor in sre module
import warnings
with guard_warnings_filter():
warnings.filterwarnings("ignore", "The sre module is deprecated",
DeprecationWarning)
from sre import _compile
def pickle_test(self, pickle):
oldpat = re.compile('
a
(
?
:
b
|
(
c
|
e
){
1
,
2
}
?
|
d
)
+
?
(.)
')
...
...
Misc/NEWS
View file @
7492e426
...
...
@@ -192,6 +192,9 @@ Core and builtins
Library
-------
-
Bug
#
1675967
:
re
patterns
pickled
with
Python
2.4
and
earlier
can
now
be
unpickled
with
Python
2.5
and
newer
.
-
Patch
#
1630118
:
add
a
SpooledTemporaryFile
class
to
tempfile
.
py
.
-
Patch
#
1273829
:
os
.
walk
()
now
has
a
"followlinks"
parameter
.
If
set
to
...
...
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