Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-145278: freeze encodings (partially) and linecache#145279

Merged
FFY00 merged 2 commits intopython:mainfrom
FFY00:gh-145278
Mar 9, 2026
Merged

GH-145278: freeze encodings (partially) and linecache#145279
FFY00 merged 2 commits intopython:mainfrom
FFY00:gh-145278

Conversation

@FFY00
Copy link
Member

@FFY00FFY00 commentedFeb 26, 2026
edited by bedevere-appbot
Loading

Signed-off-by: Filipe Laíns <lains@riseup.net>
@FFY00
Copy link
MemberAuthor

This makes it so that we don't fail at startup if the stdlib isn't insys.path.

$PYTHONHOME=nonsensePYTHON_FROZEN_MODULES=on ./python-c'print("foo!")'foo!

Which while is good, doesn't make it obvious there's an issue.GH-145274 adds a nice warning,

$PYTHONHOME=nonsensePYTHON_FROZEN_MODULES=on ./python-c'print("foo!")'WARN:Couldnotfindthestandardlibrarydirectory!ThePython'home'directorywassetto'nonsense',isthiscorrect?foo!

Signed-off-by: Filipe Laíns <lains@riseup.net>
@FFY00
Copy link
MemberAuthor

It's been a little while, and no one has raised concerns about this change. Given freezingencodings was already something we were meaning to do previously, just delayed due to technical limitations that are no longer, I am gonna go ahead and merge this.
Regardinglinecache, it is also imported during initialization, and it's a very small module without any dependencies, so I think it's a pretty reasonable inclusion.

@FFY00FFY00 merged commit3a0c716 intopython:mainMar 9, 2026
47 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotARM Raspbian 3.x (tier-3) has failed when building commit3a0c716.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/424/builds/13030) and take a look at the build logs.
  4. Check if the failure is related to this commit (3a0c716) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/424/builds/13030

Failed tests:

  • test.test_io.test_fileio

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf7a32000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf79e4000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf73ba000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf74c0000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf7456000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf7770000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf75f6000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf750a000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf75c6000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf780a000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf74ce000')Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_io/test_fileio.py", line406, incheck_readallself.assertIn(~~~~~~~~~~~~~^        fd_str,^^^^^^^        ev.args,^^^^^^^^f"Looking for file descriptor in arguments|ev={ev}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    )^AssertionError:'3' not found in ['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'] : Looking for file descriptor in arguments|ev=StraceEvent(syscall='mmap2', args=['NULL', '135168', 'PROT_READ|PROT_WRITE', 'MAP_PRIVATE|MAP_ANONYMOUS', '-1', '0'], returncode='0xf7b1a000')

@vstinner
Copy link
Member

Hi! The buildbot ARM Raspbian 3.x (tier-3) has failed when building commit3a0c716.

Hum, I don't see a direct relationship between test_io failure and this change, it seems to be unrelated.

FAIL: test_syscalls_read (test.test_io.test_fileio.CAutoFileTests.test_syscalls_read) (name='open builtin with default options')FAIL: test_syscalls_read (test.test_io.test_fileio.CAutoFileTests.test_syscalls_read) (name='open in binary mode')FAIL: test_syscalls_read (test.test_io.test_fileio.CAutoFileTests.test_syscalls_read) (name='open in text mode')FAIL: test_syscalls_read (test.test_io.test_fileio.PyAutoFileTests.test_syscalls_read) (name='open builtin with default options')FAIL: test_syscalls_read (test.test_io.test_fileio.PyAutoFileTests.test_syscalls_read) (name='open in binary mode')FAIL: test_syscalls_read (test.test_io.test_fileio.PyAutoFileTests.test_syscalls_read) (name='open in text mode')

@cocolato
Copy link
Contributor

cocolato commentedMar 9, 2026
edited
Loading

I found that the CI failure might be related to this PR:https://github.com/python/cpython/actions/runs/22859144076/job/66307879830?pr=144742.

 test_underpth_no_user_site (test.test_site._pthFileTests.test_underpth_no_user_site) ... WARN: Could not find the standard library directory! The Python 'home' directory was set to 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\test_python_hi7_pvls\\tmppyx8rtgv', is this correct?Fatal Python error: Failed to import encodings modulePython runtime state: core initializedTraceback (most recent call last):  File "<frozen encodings>", line 155, in <module>ModuleNotFoundError: No module named 'encodings._win_cp_codecs'

Perhaps we missed_win_cp_codecs?

from ._win_cp_codecsimportcreate_win32_code_page_codec

sergey-miryanov reacted with thumbs up emoji

@hugovk
Copy link
Member

Would someone like to work on a fix for Windows? Otherwise, let's revert so it doesn't block tomorrow's 3.15 alpha 7 release.

https://buildbot.python.org/#/release_status

encukou reacted with thumbs up emoji

encukou added a commit to encukou/cpython that referenced this pull requestMar 9, 2026
sergey-miryanov added a commit to sergey-miryanov/cpython that referenced this pull requestMar 9, 2026
@sergey-miryanov
Copy link
Contributor

Reverting this fixes CI for windows. But for my branch CI still failed for android.

@hugovk
Copy link
Member

Revert PR:#145689.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aaslanderlend-aasland is a code owner

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

@emmatypingemmatypingAwaiting requested review from emmatypingemmatyping is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@FFY00@bedevere-bot@vstinner@cocolato@hugovk@sergey-miryanov

[8]ページ先頭

©2009-2026 Movatter.jp