| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It's okay to be missing, but if it's given it must be an expected version (i.e. currently, 1).
* Add _print_error() helper function for printing exceptions to sys.stderr. These are not hidden behind -v * `warnings` can be lazy imported. * Since the site.toml file is no longer proposed, rewrite how .pth and .start files are parsed and processed. * addpackage() -- which was never documented -- is deprecated; there are a few usages in the wild so we can't get rid of it, but it's generally unnecessary now, has different semantics. * Update tests
Documentation build overview54 files changed · ± 54 modified ± Modified |
Sorry, something went wrong.
* 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.
|
Thanks for making the requested changes! @brettcannon, @ncoghlan: please review the changes made to this pull request. |
Sorry, something went wrong.
|
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 a problem hiding this comment.
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.
|
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.
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.
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--149109.org.readthedocs.build/