python / python/cpython

`test_compileall` failed in 2038 on 3.12 and 3.13

Open
#124,851 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.12 3.13 tests triaged type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

While working on reproducible builds for openSUSE (sponsored by the NLnet NGI0 fund), I found that
our python312 package fails to build when the build runs in a VM with
qemu-kvm -rtc base=2038-01-20T00:00:00

# Add a code block here, if required
 ======================================================================
 FAIL: test_import (test.test_compileall.HardlinkDedupTestsNoSourceEpoch.test_import)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/abuild/rpmbuild/BUILD/Python-3.12.6/Lib/test/test_py_compile.py", line 22, in wrapper 
     return fxn(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^
   File "/home/abuild/rpmbuild/BUILD/Python-3.12.6/Lib/test/test_compileall.py", line 1114, in test_import
     self.assertFalse(is_hardlink(pycs[1], pycs[2]))
 AssertionError: True is not false

3.13 seems to not be affected by the issue in test_compileall.

The full log is at https://rb.zq1.de/other/python312-ftbfs2038.log.txt
(there are also some expiring SSL certs)

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Lib/test/test_compileall.py around test_import at line 1114 and reproduce the failure using the 2038 VM clock described in the report. Compare the 3.12 and 3.13 behavior and inspect the linked build log for the hardlink result. Done means the affected compileall test passes under the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.