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.

Author eryksun
Recipients Anthony Sottile, blueyed, eryksun, jaraco, lazka, miss-islington, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-05-16.14:44:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I’m not suggesting that from within Python there should be another way 
> to detect a home directory. The expanduser functionality as written is
> just fine for that, though I agree with Steve that using an API on 
> Windows would be even better.

I thought it might be useful for testing purposes if os.path (i.e. ntpath and posixpath) had a way to set the home directory that it uses in way that wouldn't affect other libraries and child processes.

> It seems other tools like 'git' honor the HOME directory:

Many cross-platform projects follow Unix conventions, which is simpler for development and documentation. These projects are often targeted at developers, who usually have a strong understanding of Unix conventions and system configuration. But Python is a general-purpose scripting language used for everything from system administration to major applications. It needs to follow platform conventions, but it should also abstract away platform differences as much as possible. 

> Interestingly, I notice that Powershell does set the $HOME environment

Not for me in PowerShell 5 and 7:

    PS C:\> test-path 'env:userprofile'
    PS C:\> test-path 'env:home'
Date User Action Args
2020-05-16 14:44:30eryksunsetrecipients: + eryksun, paul.moore, jaraco, blueyed, tim.golden, zach.ware, steve.dower, lazka, Anthony Sottile, miss-islington
2020-05-16 14:44:30eryksunsetmessageid: <>
2020-05-16 14:44:30eryksunlinkissue36264 messages
2020-05-16 14:44:30eryksuncreate