classification
Title: distutils 'register' command and windows home directories
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder: Make .pypirc handle multiple servers
View: 1858
Assigned To: Nosy List: ajaksu2, josiahcarlson, tarek
Priority: normal Keywords:

Created on 2006-07-31 03:38 by josiahcarlson, last changed 2009-03-30 04:22 by ajaksu2. This issue is now closed.

Messages (3)
msg61249 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-07-31 03:38
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.
msg62728 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-02-23 13:51
The patch of #1858 fixes this issue as well
msg84491 - (view) Author: Daniel Diniz (ajaksu2) (Python triager) Date: 2009-03-30 04:22
Closing as the patch from issue 1858 was committed.
History
Date User Action Args
2009-03-30 04:22:22ajaksu2setstatus: open -> closed

superseder: Make .pypirc handle multiple servers

nosy: + ajaksu2
messages: + msg84491
resolution: fixed
stage: resolved
2008-02-23 13:51:27tareksetnosy: + tarek
messages: + msg62728
2006-07-31 03:38:28josiahcarlsoncreate