Karthikeyan Singaravelan <[email protected]> added the comment:
A reproducer in Python that can be added to test_compileall if needed :
def test_compile_all_2038(self):
with open(self.source_path, 'r') as f:
os.utime(f.name, (2147558400, 2147558400)) # Jan 20, 2038 as touch
self.assertTrue(compileall.compile_file(pathlib.Path(self.source_path)))
./python.exe -m unittest -v
test.test_compileall.CompileallTestsWithSourceEpoch.test_compile_all_2038
test_compile_all_2038 (test.test_compileall.CompileallTestsWithSourceEpoch) ...
ERROR
======================================================================
ERROR: test_compile_all_2038
(test.test_compileall.CompileallTestsWithSourceEpoch)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_py_compile.py",
line 30, in wrapper
return fxn(*args, **kwargs)
File
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_compileall.py",
line 114, in test_compile_all_2038
self.assertTrue(compileall.compile_file(pathlib.Path(self.source_path)))
File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/compileall.py",
line 142, in compile_file
expect = struct.pack('<4sll', importlib.util.MAGIC_NUMBER,
struct.error: 'l' format requires -2147483648 <= number <= 2147483647
----------------------------------------------------------------------
Thanks
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34990>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com