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 josiahcarlson
Recipients
Date 2006-07-31.03:38:28
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The current version of the Distutils 'register' command
does not support Windows 2k or XP home directories, as
it checks for 'HOME' in os.environ .  This is suffient
for posix platforms, but for Windows 2k and XP,
generally 'home directories' are specified via the
environment variable 'USERPROFILE', or can be
constructed from 'HOMEDRIVE' and 'HOMEPATH'.

A simple fix would be to create two functions:
has_home() and get_home(), whose purposes are to
determine whether a home directory exists for the
current platform, and to get the home directory for the
current platform, respectively.

A sample implementation of both functions is as follows
(replace the leading commas with spaces).

keys = ['HOME', 'USERPROFILE']

def has_home():
,,,,for i in keys:
,,,,,,,,if i in os.environ:
,,,,,,,,,,,,return 1
,,,,return 0

def get_home():
,,,,for i in keys:
,,,,,,,,if i in os.environ:
,,,,,,,,,,,,return os.environ[i]


Once those definitions are made, then the two relevant
portions of
distutils.command.register.register.set_metadata() can
be updated to use these two functions.
History
Date User Action Args
2008-01-20 09:59:48adminlinkissue1531505 messages
2008-01-20 09:59:48admincreate