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

Path.home() should ignore HOME env var like os.path.expanduser() #83064

Closed
lazka mannequin opened this issue Nov 21, 2019 · 4 comments
Closed

Path.home() should ignore HOME env var like os.path.expanduser() #83064

lazka mannequin opened this issue Nov 21, 2019 · 4 comments
Labels
3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@lazka
Copy link
Mannequin

lazka mannequin commented Nov 21, 2019

BPO 38883
Nosy @brettcannon, @zooba, @lazka, @asottile, @miss-islington, @isidentical
PRs
  • bpo-38883: Don't honor POSIX HOME in pathlib.Path.home/expanduser on Windows #17961
  • [3.8] bpo-38883: Don't use POSIX $HOME in pathlib.Path.home/expanduser on Windows (GH-17961) #18229
  • 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 2020-01-28.09:59:05.741>
    created_at = <Date 2019-11-21.18:45:12.057>
    labels = ['3.8', 'library', '3.9']
    title = 'Path.home() should ignore HOME env var like os.path.expanduser()'
    updated_at = <Date 2020-01-28.09:59:47.636>
    user = 'https://github.com/lazka'

    bugs.python.org fields:

    activity = <Date 2020-01-28.09:59:47.636>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-28.09:59:05.741>
    closer = 'steve.dower'
    components = ['Library (Lib)']
    creation = <Date 2019-11-21.18:45:12.057>
    creator = 'lazka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38883
    keywords = ['patch']
    message_count = 4.0
    messages = ['357196', '360847', '360852', '360854']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'steve.dower', 'lazka', 'Anthony Sottile', 'miss-islington', 'BTaskaya']
    pr_nums = ['17961', '18229']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38883'
    versions = ['Python 3.8', 'Python 3.9']

    @lazka
    Copy link
    Mannequin Author

    lazka mannequin commented Nov 21, 2019

    In bpo-36264 os.path.expanduser() was changed to no longer use the HOME environment variable on Windows.

    There are two more ways in the stdlib to get the user directory, pathlib.Path.home() and pathlib.Path.expanduser() which internally use gethomedir() which still uses the HOME environment variable:

    def gethomedir(self, username):

    Since they are documented to work the same as os.path.expanduser() they should be changed to no longer use HOME as well.

    @lazka lazka mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir labels Nov 21, 2019
    @isidentical isidentical added 3.9 only security fixes 3.8 only security fixes and removed 3.8 only security fixes labels Nov 21, 2019
    @zooba
    Copy link
    Member

    zooba commented Jan 28, 2020

    New changeset c45a2aa by Steve Dower (Christoph Reiter) in branch 'master':
    bpo-38883: Don't use POSIX $HOME in pathlib.Path.home/expanduser on Windows (GH-17961)
    c45a2aa

    @zooba
    Copy link
    Member

    zooba commented Jan 28, 2020

    Thanks, Christoph!

    @zooba zooba closed this as completed Jan 28, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset 595b516 by Miss Islington (bot) in branch '3.8':
    bpo-38883: Don't use POSIX $HOME in pathlib.Path.home/expanduser on Windows (GH-17961)
    595b516

    @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.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants