[issue36264] os.path.expanduser should not use HOME on windows

Paul Moore report at bugs.python.org
Sat May 16 06:08:43 EDT 2020


Paul Moore <p.f.moore at gmail.com> added the comment:

> Perhaps the best approach for the sake of POSIX compatibility is to set HOME on startup to the correct value? 

If Python starts setting `HOME`, that has the potential to affect programs called in a subprocess, possibly breaking them (making them not find the user's config, for example). Even if we only set `HOME` when it's not already set, we can get this issue. (Vim, for example, will break if you set HOME to somewhere other than where the user has their config stored).

Certainly, it's arguable that such programs are not respecting Windows conventions correctly, but in practical terms that's not really that relevant. The user will just see it as "Python can't call my program correctly".

This is a very real issue, that I used to hit a lot in the past, when native Windows support was a lot less common in open source code than it is now. And it was nearly always made worse by the programs that tried to be "too clever" about hiding the differences between Windows and Unix.

So I'm a strong -1 on Python doing anything with `HOME` here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36264>
_______________________________________


More information about the Python-bugs-list mailing list