Message369049
> 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'
True
PS C:\> test-path 'env:home'
False |
|
Date |
User |
Action |
Args |
2020-05-16 14:44:30 | eryksun | set | recipients:
+ eryksun, paul.moore, jaraco, blueyed, tim.golden, zach.ware, steve.dower, lazka, Anthony Sottile, miss-islington |
2020-05-16 14:44:30 | eryksun | set | messageid: <1589640270.78.0.403598541434.issue36264@roundup.psfhosted.org> |
2020-05-16 14:44:30 | eryksun | link | issue36264 messages |
2020-05-16 14:44:30 | eryksun | create | |
|