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: Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Rosuav, ezio.melotti, michael.foord, miss-islington, terry.reedy, vstinner
Priority: normal Keywords: patch

Created on 2016-08-19 22:05 by Rosuav, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
no-site-packages-in-test.patch Rosuav, 2016-08-19 22:06 review
Pull Requests
URL Status Linked Edit
PR 19060 merged vstinner, 2020-03-18 15:17
PR 19089 closed miss-islington, 2020-03-20 13:02
PR 19090 merged vstinner, 2020-03-20 13:04
PR 19093 merged miss-islington, 2020-03-20 14:10
Messages (8)
msg273160 - (view) Author: Chris Angelico (Rosuav) * Date: 2016-08-19 22:05
Having matplotlib installed globally causes test_site to fail, due to the .pth file importing types. The point of the test is to monitor startup dependencies (and thus time) for the core interpreter and standard library, not third-party libraries, so having a test failure due to a .pth is not overly useful.

Solution suggested by Steve Dower: hack out all .pth handling during this one test, leaving everything else unchanged.
msg273165 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-08-19 23:27
I think hitting adventurous users like Chris who locally compile and test with this failure is wrong.  There is no core dev 'site' expert, so I picked 'testing'.
msg364523 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-18 15:00
Fedora and RHEL downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=1814392
msg364526 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-18 15:14
I marked bpo-35691 as a duplicate of this issue.
msg364536 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-18 17:27
New changeset d18de46117d661a4acaf2380cc5ebb1cf6a000e9 by Victor Stinner in branch 'master':
bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060)
https://github.com/python/cpython/commit/d18de46117d661a4acaf2380cc5ebb1cf6a000e9
msg364668 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-20 14:10
New changeset ba26bf30940f4347fedcf8ebc374c6e2dc375afa by Victor Stinner in branch '3.8':
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
https://github.com/python/cpython/commit/ba26bf30940f4347fedcf8ebc374c6e2dc375afa
msg364672 - (view) Author: miss-islington (miss-islington) Date: 2020-03-20 14:28
New changeset 6056b7b84f2f77e2c3b49a18cfebe061fc23a08a by Miss Islington (bot) in branch '3.7':
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
https://github.com/python/cpython/commit/6056b7b84f2f77e2c3b49a18cfebe061fc23a08a
msg364673 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-20 14:32
The issue is now fixed in 3.7, 3.8 and master branches.

Thanks Chris Angelico for the bug report.
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 71994
2020-03-20 14:32:53vstinnersetstatus: open -> closed
versions: + Python 3.7, Python 3.8, Python 3.9, - Python 3.6
messages: + msg364673

resolution: fixed
stage: patch review -> resolved
2020-03-20 14:28:02miss-islingtonsetmessages: + msg364672
2020-03-20 14:10:37miss-islingtonsetpull_requests: + pull_request18453
2020-03-20 14:10:20vstinnersetmessages: + msg364668
2020-03-20 13:04:25vstinnersetpull_requests: + pull_request18450
2020-03-20 13:02:57miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request18449
2020-03-18 17:27:51vstinnersetmessages: + msg364536
2020-03-18 15:17:14vstinnersetstage: patch review
pull_requests: + pull_request18413
2020-03-18 15:15:26vstinnersettitle: Prevent site-packages .pth files from causing test_site failure -> Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure
2020-03-18 15:14:59vstinnersetmessages: + msg364526
2020-03-18 15:14:44vstinnerlinkissue35691 superseder
2020-03-18 15:00:02vstinnersetnosy: + vstinner
messages: + msg364523
2016-08-19 23:27:59terry.reedysetnosy: + ezio.melotti, terry.reedy, michael.foord
messages: + msg273165
2016-08-19 22:06:20Rosuavsetfiles: + no-site-packages-in-test.patch
keywords: + patch
2016-08-19 22:05:23Rosuavcreate