Skip to content

Conversation

@itamaro
Copy link
Contributor

@itamaro itamaro commented Nov 16, 2025

I still don't know what's the context behind this assertion, just that I didn't see any issues from removing it.

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
@encukou
Copy link
Member

encukou commented Nov 17, 2025

It was added in #118204

@ericsnowcurrently, do you remember if there was a reason for this assert?
Can we assume you added asserts when exploring which code paths are taken, and since we had no tests for modules with a dot added via PyImport_AppendInittab, this assert just never fired?


@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?

@brettcannon brettcannon removed their request for review November 17, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants