Skip to content

test_site must not write outside the build directory: must not write into $HOME/.local/ #74413

Closed

Description

@vstinner
BPO 30227
Nosy @vstinner, @merwok, @dstufft

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 2018-09-19.23:11:54.605>
created_at = <Date 2017-05-02.10:15:21.636>
labels = ['tests', '3.7', 'library']
title = 'test_site must not write outside the build directory: must not write into $HOME/.local/'
updated_at = <Date 2018-09-19.23:11:54.604>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2018-09-19.23:11:54.604>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2018-09-19.23:11:54.605>
closer = 'vstinner'
components = ['Distutils', 'Tests']
creation = <Date 2017-05-02.10:15:21.636>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 30227
keywords = []
message_count = 1.0
messages = ['292739']
nosy_count = 3.0
nosy_names = ['vstinner', 'eric.araujo', 'dstufft']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue30227'
versions = ['Python 3.7']

Activity

  1. vstinner commented on May 2, 2017

    @vstinner
    MemberAuthor

    test_site creates the $HOME/.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 environment variable and mock the home directory.

    Example of issue of writing into $HOME:

    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 is set to /. The whole test_site test is skipped just because of that.

    Recent change on test_site related to this issue: commit b85c136, bpo-30108.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    testsTests in the Lib/test dir
    on May 2, 2017
  3. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions