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 Anthony Sottile
Recipients Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-03-11.16:09:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The current code for `os.path.expanduser` in `ntpath` uses `HOME` in preference to `USERPROFILE` / `HOMEDRIVE\\HOMEPATH`

I can't find any documentation of `HOME` being relevant on windows (only on posix).  For example, wikipedia only mentions `USERPROFILE` / `HOMEDRIVE\\HOMEPATH` options:

Seems to be (one of) the direct causes of a downstream bug for me:

(msys sets `HOME` to a bogus value if `HOMEDRIVE` is set, then python uses it)

My proposal is to remove these lines and change the `elif` to an `if`:
Date User Action Args
2019-03-11 16:09:57Anthony Sottilesetrecipients: + Anthony Sottile, paul.moore, tim.golden, zach.ware, steve.dower
2019-03-11 16:09:57Anthony Sottilesetmessageid: <>
2019-03-11 16:09:57Anthony Sottilelinkissue36264 messages
2019-03-11 16:09:57Anthony Sottilecreate