Alyssa Coghlan
Alyssa Coghlan
A problem we're starting to see on distutils-sig is folks trying to type pip commands into the Python REPL rather than their system shell, and getting cryptic syntax errors back:...
Paul Moore pointed out on distutils-sig that since this is mainly desired for the REPL, we can put the logic in the default excepthook rather than into the SyntaxError constructor...
Given that this can be done with just an excepthook change, I'm going to suggest we make the change for 3.5 and 2.7 as well.
Intentionally reloading modules isn't forbidden usage. It's typically *weird* usage, but it's not forbidden. We include explicit workarounds in the import machinery so the interpreter doesn't die when extension modules...
As noted in https://github.com/python/cpython/issues/117398#issuecomment-2106112547, this may be a test coverage concern moreso than an SC design decision. I doubt the existing test suite explicitly covers the situation we're concerned about...
While you're correct that `PyModule_GetState` and `PyCapsule_GetPointer` are both technically exposed to the same pointer invalidation problem if a C module is reloaded, there's a key difference in their intended...
@erlend-aasland also pointed out this past discussion of the external-resource-management variant of this problem (which leads to needing the ability to set up per-process locks rather than per-interpreter ones): https://discuss.python.org/t/a-new-c-api-for-extensions-that-need-runtime-global-locks/20668
Right, the specific problem in the `_datetime` case is ensuring pointer stability across module reloads for both its C API and its capsule API. There is a similar-but-distinct problem that...
Yeah, it would mean generalising the doc a bit, which is why I didn't just go ahead and make a PR - there's a genuine SC discussion/decision needed on whether...
I became sufficiently frustrated with this limitation that I'm currently porting some tests over to `unittest` specifically to reliably obtain comprehensive diffs when the tests fail (the tests are comparing...