Issue 30227: test_site must not write outside the build directory: must not write into $HOME/.local/ (original) (raw)

Issue30227

Created on 2017-05-02 10:15 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (1)
msg292739 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 10:15
test_site creates the HOME/.local/lib/python3.7/site−packages/directory,orparentdirectoriesifneeded.That′swrong.Anunittestmustnotmodifyitsenvironment,especiallythehomedirectory!TheunittestmustmockHOME/.local/lib/python3.7/site-packages/ directory, or parent directories if needed. That's wrong. An unit test must not modify its environment, especially the home directory! The unit test must mock HOME/.local/lib/python3.7/sitepackages/directory,orparentdirectoriesifneeded.Thatswrong.Anunittestmustnotmodifyitsenvironment,especiallythehomedirectory!TheunittestmustmockHOME environment variable and mock the home directory. Example of issue of writing into HOME:[http://buildbot.python.org/all/builders/AMD64HOME: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.5/builds/75/steps/test/logs/stdio [109/398] test_site test_site skipped -- unable to create user site directory ('/.local/lib/python3.5/site-packages'): [Errno 13] Permission denied: '/.local' On this buildbot, HOME:[http://buildbot.python.org/all/builders/AMD64HOME is set to /. The whole test_site test is skipped just because of that. Recent change on test_site related to this issue: commit b85c136903c6d2368162f7c4a58f258c9c69ead0, bpo-30108.
History
Date User Action Args
2022-04-11 14:58:45 admin set github: 74413
2018-09-19 23:11:54 vstinner set status: open -> closedresolution: out of datestage: resolved
2017-05-02 10:15:21 vstinner create