cpython: cb13d8cff050 (original) (raw)

Mercurial > cpython

changeset 74597:cb13d8cff050

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:45:50 +0100
parents 75a3d35309cf(current diff)a2f3d6986bfa(diff)
children 454d1c52f3e0
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 @@ -123,6 +123,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 @@ -306,6 +306,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.3 Alpha 1? Core and Builtins ----------------- +- Issue #11235: Fix OverflowError when trying to import a source file whose

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

#endif if (PyUnicode_READY(pathname) < 0) return NULL;