diff options
author | Žiga Seilnacht <ziga.seilnacht@gmail.com> | 2007-03-21 20:07:56 +0000 |
---|---|---|
committer | Žiga Seilnacht <ziga.seilnacht@gmail.com> | 2007-03-21 20:07:56 +0000 |
commit | 7492e4260e4f6231f6f30a0f10f514115b9233cb (patch) | |
tree | 826f8de8fc8403ea49a6fb682c18f4c940a959c4 | |
parent | 3ff9e558901b49551e27ee48a1fb39b65037e889 (diff) | |
download | cpython-git-7492e4260e4f6231f6f30a0f10f514115b9233cb.tar.gz |
Bug #1675967: re patterns pickled with older Python versions can
now be unpickled. Will backport.
-rw-r--r-- | Lib/sre.py | 3 | ||||
-rw-r--r-- | Lib/test/test_re.py | 8 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/Lib/sre.py b/Lib/sre.py index 390094aaa6..c04576bafa 100644 --- a/Lib/sre.py +++ b/Lib/sre.py @@ -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 diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 14a0acfc6b..bb568612fa 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1,7 +1,7 @@ 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)+?(.)') @@ -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 |