Skip to content

bpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. #29040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Oct 18, 2021

The recently added PyConfig.stdlib_dir was being set with ".." entries. When __file__ was added for from modules this caused a problem on out-of-tree builds. This PR fixes that by normalizing "stdlib_dir" when it is calculated in getpath.c.

https://bugs.python.org/issue45506

Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./python -m test.regrtest test_embed -v still fails in an out of tree build for me with this change. As does test_gdb. Both appear to be having trouble importing encodings? Others such as test_importlib no longer fail.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@warsaw
Copy link
Member

warsaw commented Oct 18, 2021

I ran the full test suite:

8 tests failed:
    test_compileall test_embed test_import test_importlib test_inspect
    test_pyclbr test_socket test_unittest

Copy link
Member

@warsaw warsaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with this PR, test_embed and test_unittest still fail.

@ericsnowcurrently
Copy link
Member Author

Hmm, I don't get failures in test_unittest. At this point, I've fixed the problem with test_embed and only need to deal with failures in subprocess due to that first commit.

@ericsnowcurrently ericsnowcurrently changed the title bpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. bpo-45506: Fix tests on out-of-tree builds. Oct 19, 2021
@ericsnowcurrently
Copy link
Member Author

With that latest commit I got all the tests to pass in an out-of-tree build.

@gpshead gpshead self-assigned this Oct 19, 2021
@ericsnowcurrently ericsnowcurrently changed the title bpo-45506: Fix tests on out-of-tree builds. bpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. Oct 19, 2021
@ericsnowcurrently

This comment has been minimized.

Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this one is good. test_embed still fails for me using this branch but I think there was another PR you already merged that addressed that.

@bedevere-bot
Copy link

@ericsnowcurrently: Please replace # with GH- in the commit message next time. Thanks!

@ericsnowcurrently ericsnowcurrently deleted the getpath-normalize-stdlib_dir branch October 22, 2021 23:20
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.

5 participants