Skip to content
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

test_sys: test_stdlib_dir() fails when Python is built outside the source tree #89566

Closed
vstinner opened this issue Oct 7, 2021 · 3 comments
Closed
Labels
3.11 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Oct 7, 2021

BPO 45403
Nosy @vstinner
PRs
  • bpo-45403: Fix test_sys.test_stdlib_dir() #28785
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-10-07.19:22:47.725>
    created_at = <Date 2021-10-07.11:25:38.672>
    labels = ['tests', '3.11']
    title = 'test_sys: test_stdlib_dir() fails when Python is built outside the source tree'
    updated_at = <Date 2021-10-07.19:22:47.724>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2021-10-07.19:22:47.724>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-07.19:22:47.725>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-10-07.11:25:38.672>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45403
    keywords = ['patch']
    message_count = 3.0
    messages = ['403389', '403391', '403438']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['28785']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45403'
    versions = ['Python 3.11']

    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 7, 2021

    Reproduce the issue:
    ---
    # go to Python source tree
    mkdir build
    cd build
    ../configure
    make
    ./python -m test test_sys
    ---

    Output:

    ======================================================================
    FAIL: test_stdlib_dir (test.test_sys.SysModuleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/vstinner/python/main/Lib/test/test_sys.py", line 1005, in test_stdlib_dir
        self.assertEqual(actual, expected)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: '/home/vstinner/python/main/build/../Lib' != '/home/vstinner/python/main/Lib'
    - /home/vstinner/python/main/build/../Lib
    ?                            

    + /home/vstinner/python/main/Lib

    Attached PR fix the issue.

    @vstinner vstinner added 3.11 only security fixes tests Tests in the Lib/test dir labels Oct 7, 2021
    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 7, 2021

    Python 3.10 is not affected: sys._stdlib_dir was added to Python 3.11.

    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 7, 2021

    New changeset 768aaf6 by Victor Stinner in branch 'main':
    bpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)
    768aaf6

    @vstinner vstinner closed this as completed Oct 7, 2021
    @vstinner vstinner closed this as completed Oct 7, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant