This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_sys: test_stdlib_dir() fails when Python is built outside the source tree
Type: Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2021-10-07 11:25 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28785 merged vstinner, 2021-10-07 11:29
Messages (3)
msg403389 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 11:25
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.
msg403391 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 11:31
Python 3.10 is not affected: sys._stdlib_dir was added to Python 3.11.
msg403438 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 19:22
New changeset 768aaf6c433e6a13b82c7bdebd0062c7472c1fc7 by Victor Stinner in branch 'main':
bpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)
https://github.com/python/cpython/commit/768aaf6c433e6a13b82c7bdebd0062c7472c1fc7
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89566
2021-10-07 19:22:47vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-10-07 19:22:33vstinnersetmessages: + msg403438
2021-10-07 11:31:18vstinnersetmessages: + msg403391
2021-10-07 11:29:05vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request27120
2021-10-07 11:25:38vstinnercreate