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.

Title: "HOME" is not a standard environment variable on Windows
Type: Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: tarek Nosy List: ezio.melotti, ggenellina, tarek, zooko
Priority: normal Keywords:

Created on 2009-07-23 20:09 by zooko, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg90861 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2009-07-23 20:09
The distutils looks in an environment variable named "HOME" on Windows:

Windows does not by default create such a variable, so only if a user
has manually configured one will it work.  The standard variable for
this purpose on Windows appears to be spelled "USERPROFILE":
msg91440 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-08-10 11:47
I tried to echo both %HOME% and %USERPROFILE% on a few windows systems
(XP, 2k3 Server and Vista) and only the latter worked. %HOME% is not set
in any of these systems.
msg91543 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-08-14 08:30
%HOME% isn't set by Windows.
%HOMEDRIVE%%HOMEPATH% points to the user's home directory.
%USERPROFILE% is where the user's profile is stored, and may or may not 
be the same as his home directory.

%HOMEDRIVE%%HOMEPATH% should be used then, defaulting to %USERPROFILE% 
only when those variables are not set (that's unlikely, but could 
happen e.g. with the runas command)
msg91569 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-08-14 20:20
The code works as expected because it uses os.path.expanduser('~'),
which will look to the right values depending on the platform.

So it's just the documentation that is wrong about how distutils behaves
under Windows.

I'll fix this doc asap, thanks for the feedback.
msg91829 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-08-21 14:52
Fixed, thanks for the feedback all !
Date User Action Args
2022-04-11 14:56:51adminsetgithub: 50805
2009-08-21 14:52:52tareksetstatus: open -> closed

messages: + msg91829
2009-08-14 20:20:49tareksetversions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2
nosy: zooko, ggenellina, tarek, ezio.melotti
messages: + msg91569

components: + Documentation, - Distutils
resolution: accepted
2009-08-14 08:30:20ggenellinasetnosy: + ggenellina
messages: + msg91543
2009-08-10 11:47:31ezio.melottisetpriority: normal
nosy: + ezio.melotti
messages: + msg91440

2009-07-23 20:09:20zookocreate