Issue 6556: "HOME" is not a standard environment variable on Windows (original) (raw)

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: http://docs.python.org/install/#location-and-names-of-config-files 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": http://en.wikipedia.org/wiki/Environment_variable
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 !
History
Date User Action Args
2022-04-11 14:56:51 admin set github: 50805
2009-08-21 14:52:52 tarek set status: open -> closedmessages: +
2009-08-14 20:20:49 tarek set versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2nosy:zooko, ggenellina, tarek, ezio.melottimessages: + components: + Documentation, - Distutilsresolution: accepted
2009-08-14 08:30:20 ggenellina set nosy: + ggenellinamessages: +
2009-08-10 11:47:31 ezio.melotti set priority: normalnosy: + ezio.melottimessages: +
2009-07-23 20:09:20 zooko create