GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — gh-148641: Implement PEP 829 - startup configuration files by warsaw · Pull Request #149109 · python/cpython Conversation
|
Documentation build overview
54 files changed ·
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* flush_pth_start() -> process_startup_files() * Move around some versionchanged and deprecated-removed sections * Add: kw-only arg `defer_processing_start_files` in several places to ensure that the reverse-engineered semantics of the undocumented functions are preserved.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @brettcannon, @ncoghlan: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I just saw this after resolving all the previous comments.
Please take a look at the updates I just pushed. I see what you’re suggesting, although that does seem like a larger change to make. See what you think of the current PR branch.
… On May 2, 2026, at 18:38, Alyssa Coghlan ***@***.***> wrote:
@ncoghlan commented on this pull request.
In Lib/site.py:
> if reset:
+ flush_pth_start()
Yeah, I didn't see a way to reliably infer the intent from the existing args, hence suggesting a new keyword arg.
That has the benefit of letting sitecustomize and usercustomize authors invoke similar batch processing behaviour.
The other way we could do it is instead of passing in a keyword boolean and updating global variables, we could instead define a StartupFiles helper class with the pending sets on each instance, and accept a pending_startup: StartupFiles | None parameter on each of the functions that modify the pending sets. Then actually running the startup files would be a StartupFiles.process instance method rather than a new module level function. (I only thought of that approach just now, otherwise I would have suggested it in my review comments)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks @warsaw, this iteration looks good for 3.15b1 to me (one minor parameter naming nitpick, but it's in an API detail I'd like to revisit in more depth for 3.15b2 anyway, hence I don't think it's a merge blocker)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Argh! Sorry for the typo in the review dismissal. GH doesn't actually autocomplete in that dialog and it can't be edited. Approval was received from @ncoghlan |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Six tests in the local subprocess and parallel suites fail on the weekly Python 3.15 check (run [25667044284](https://github.com/tox-dev/tox/actions/runs/25667044284)) because every spawned interpreter prints a `KeyError` to stderr before user code runs, and the assertions compare stderr byte-for-byte. The noise originates in the legacy `*-nspkg.pth` files shipped by `PasteDeploy 3.1.0` and `repoze.lru 0.7`, both pulled in transitively by `devpi-server` → `pyramid`. Those pth files call `sys._getframe(1).f_locals['sitedir']`, which worked when `site.py` walked its own frame. PEP 829 (CPython [#149109](python/cpython#149109)) replaced that machinery with a deferred `_exec_imports()` that has no `sitedir` local, so every interpreter startup raises `KeyError: "local variable ''sitedir'' is not defined"`. The regression is tracked upstream in CPython [#149671](python/cpython#149671). This is genuinely an upstream problem: the proper fix lives either in CPython (restoring compatibility with legacy `.pth` hacks, or providing a migration path) or in `setuptools` (which still generates these pth files for `namespace_packages=` declarations even though `pkg_resources` was removed in 82.0.0). The `paste` and `repoze` namespaces would still resolve via PEP 420 without the `.pth` shim, so the affected packages could also drop `namespace_packages=` upstream. Until any of those land, this patch removes the offending pth files at conftest import — gated by the broken `f_locals['sitedir']` substring so unrelated namespace pth files are untouched, and wrapped in `contextlib.suppress(OSError)` to stay idempotent under `xdist` workers racing on the same file. Revert once the upstream fix is available.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.