[WIP] bpo-42260: Rewrite getpath.c in Python#23169
[WIP] bpo-42260: Rewrite getpath.c in Python#23169vstinner wants to merge 2 commits intopython:mainfrom vstinner:getpath_py
Conversation
|
The PR is still a draft. Modules/getpath.c is reimplemented in pure Python as Lib/_getpath.py. The module is frozen by "make regen-importlib" and run by by pyinit_main(): I kept Modules/getpath.c to ease development, but it will be fully removed in the final patch. There are likely bugs in my conversion from getpath.c (C) to _getpath.py (Python). The new Python module gets a companion _cgetpath: a C extension to expose functions needed by _getpath (Python). Code size: 1623 lines for getpath.c (C) => 654 lines for _getpath.py (Python), and way simpler string manipulation: 2.5x smaller code. Right now, 4 tests are still failing (test_embed, test_sys, test_gdb and a 4th that I forgot!). |
* Add _getpath Python module and _cgetpath C module * Py_SetPath() no longer computes the path configuration. * _PyErr_SetFromPyStatus() now raises SystemExit if the status is an exit code.
Also move PathConfig class
|
Remaining issue: test_init_read_set() fails. The error on Windows is different than the error on Linux/macOS. Windows: Linux/macOS: |
|
This PR is stale because it has been open for 30 days with no activity. |
https://bugs.python.org/issue42260