GeezerVison is showing github.com — gh-91338: Ensure test_ucnhash_capi_reset doesn't pass PYTHONHOME to _testembed.exe by neonene · Pull Request #32313 · python/cpython
Conversation
neonene
commented
Apr 4, 2022
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
A minor tweak for Windows. _test_embed.exe fails to import *.pyd modules when the initialization is repeated with PYTHONHOME from python.bat.
>python.bat -m test test_embed -v
======================================================================
FAIL: test_ucnhash_capi_reset (test.test_embed.EmbeddingTests.test_ucnhash_capi_reset)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\cpython\Lib\test\test_embed.py", line 349, in test_ucnhash_capi_reset
out, err = self.run_embedded_interpreter("test_repeated_init_exec", code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\cpython\Lib\test\test_embed.py", line 117, in run_embedded_interpreter
stdout:
9
stderr:
--- Loop #1 ---
--- Loop #2 ---
File "<string>", line 1
print('\N{digit nine}')
^
SyntaxError: (unicode error) \N escapes not supported (can't load unicodedata module)
sys.path at Loop#1 has the build directory, which is replaced with f"{PYTHONHOME}/DLLs" at the next loop. The behavior looks realistically designed.
GitHub CI machines doesn't show the error, using rt.bat where PYTHONHOME is not set.
https://bugs.python.org/issue47182
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@zooba, could you take a look at this?
I'll close if unnecessary.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
We have a few other tests that use the same function. I'd assume we either need to update all of them (because they're all "wrong", even if they're not triggering it yet), or make sure that the values aren't regenerated differently.
Do we know the root cause of the changed value?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
neonene
changed the title
bpo-47182: Ensure test_ucnhash_capi_reset doesn't pass PYTHONHOME to _testembed.exe
gh-91338: Ensure test_ucnhash_capi_reset doesn't pass PYTHONHOME to _testembed.exe
Apr 26, 2022
|
Holding the value of platstdlib_dir for getpath.py would fix the root cause.
My implementation was modifying PyConfig and _PyPathConfig structures.
This PR (updated) is less risky for me.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
neonene
commented
Apr 27, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Do we know the root cause of the changed value?
I'll close this and open an issue, considering that the current behavior, which I think is practical, may be unintentional.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
tiran
tiran approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|