cpython: a2f3d6986bfa (original) (raw)

Mercurial > cpython

changeset 74596:a2f3d6986bfa 3.2

Issue #11235: Fix OverflowError when trying to import a source file whose modification time doesn't fit in a 32-bit timestamp. [#11235]

Antoine Pitrou solipsis@pitrou.net
date Tue, 24 Jan 2012 17:44:06 +0100
parents f7d3a754bc02
children cb13d8cff050 365d0e387179
files Lib/importlib/test/source/test_file_loader.py Lib/test/test_import.py Misc/NEWS Python/import.c
diffstat 4 files changed, 36 insertions(+), 7 deletions(-)[+] [-] Lib/importlib/test/source/test_file_loader.py 17 Lib/test/test_import.py 12 Misc/NEWS 3 Python/import.c 11

line wrap: on

line diff

--- a/Lib/importlib/test/source/test_file_loader.py +++ b/Lib/importlib/test/source/test_file_loader.py @@ -128,6 +128,23 @@ class SimpleTest(unittest.TestCase): pycache = os.path.dirname(imp.cache_from_source(file_path)) shutil.rmtree(pycache)

+ class BadBytecodeTest(unittest.TestCase):

--- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -310,6 +310,18 @@ class ImportTests(unittest.TestCase): """)) script_helper.assert_python_ok(testfn)

+ class PycRewritingTests(unittest.TestCase): # Test that the co_filename attribute on code objects always points

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.2.3? Core and Builtins ----------------- +- Issue #11235: Fix OverflowError when trying to import a source file whose

--- a/Python/import.c +++ b/Python/import.c @@ -1304,14 +1304,11 @@ load_source_module(char *name, char pat } #if SIZEOF_TIME_T > 4 / Python's .pyc timestamp handling presumes that the timestamp fits

#endif cpathname = make_compiled_pathname( pathname, buf, (size_t)MAXPATHLEN + 1, !Py_OptimizeFlag);