| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
with this, test_embed fails with ``` Assertion failed: (PyUnicode_FindChar(name, '.', 0, PyUnicode_GetLength(name), -1) == -1), function _Py_ext_module_loader_info_init_for_builtin, file importdl.c, line 159. ```
with this, test_embed succeeds again
|
It was added in #118204 @ericsnowcurrently, do you remember if there was a reason for this assert? @itamaro: I'd be a bit more careful in _testembed: from test import create_static_module assumes that the test package is available, which is not always the case. I don't think you'd necessarily want to run testembed without test, but I also don't think we should add an arbitrary requirement/assumption. Could you add a different containing package to the inittab? |
Sorry, something went wrong.
Can _testembed even be meaningfully used without the test package? (and test_embed.py driving it) Regardless, I agree this is an awkward way to test this. I think it would make more sense to add a net new test case for this functionality, if we decide it's a desired functionality we don't want to regress. |
Sorry, something went wrong.
|
I'd say that as an embedder, you're probably in the best position both to test this, and to decide if it's desired functionality. Allowing submodules in inittab looks doable. (@brettcannon, do you have any thoughts on BuiltinImporter loading submodules?) Allowing packages, on the other hand, might be worth more discussion -- that would probably need new API, since struct _inittab doesn't have the is_package bit.
It can! Not sure if it's meaningful to run it without the test package available, but I do use the CLI on its own when debugging. Anyway that's not the question to ask. More coupling bad, self-contained good :) |
Sorry, something went wrong.
|
thanks @encukou |
Sorry, something went wrong.
I think it's fine to add. I suspect it didn't have it just because the need never came up. |
Sorry, something went wrong.
This reverts commit 4949865.
covering both single-phase init and multi-phase init embedded extensions
|
@encukou I added new dedicated tests |
Sorry, something went wrong.
There was a problem hiding this comment.
This looks good, thank you!
Sorry, something went wrong.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Looks good, thank you! |
Sorry, something went wrong.
|
Sorry, @itamaro and @encukou, I could not cleanly backport this to 3.14 due to a conflict. cherry_picker 27f62eb711720c215f9798ae30728ee5a1b4d442 3.14 |
Sorry, something went wrong.
|
Sorry, @itamaro and @encukou, I could not cleanly backport this to 3.13 due to a conflict. cherry_picker 27f62eb711720c215f9798ae30728ee5a1b4d442 3.13 |
Sorry, something went wrong.
…bedded modules from packages (pythonGH-141605) (cherry picked from commit 27f62eb)
|
GH-141986 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…bedded modules from packages (pythonGH-141605) (cherry picked from commit 27f62eb)
|
GH-141987 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…bedded modules from packages (pythonGH-141605)
…bedded modules from packages (pythonGH-141605)
| Back | FazBrowse Home | New Git URL |
I still don't know what's the context behind this assertion, just that I didn't see any issues from removing it.