[Patches] [ python-Patches-523424 ] Finding "home" in "user.py" for Windows
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 18 Mar 2002 00:42:52 -0800
Patches item #523424, was opened at 2002-02-27 16:03
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=523424&group_id=5470
Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Gilles Lenfant (glenfant)
Assigned to: Nobody/Anonymous (nobody)
>Summary: Finding "home" in "user.py" for Windows
Initial Comment:
On my win2k French box + python 2.1.2:
>>> import user
>>> user.home
'C:\'
This isn't a great issue but this means that all users
of this win2k box will share the same ".pythonrc.py".
The code provided by Jeff Bauer can be changed easily
because the standard Python distro now has a "_winreg"
module.
This patch gives the real user $HOME like folder for
any user on whatever's Windows localization:
>>> import user
>>> user.home
u'C:\Documents and Settings\MyWindowsUsername\Mes
documents'
This has been successfully tested with Win98 and
Win2000. This should be tested on XP, NT4, and 95 but
I can't.
Sorry for the "context or unified diffs" (dunno what
it means) but the module is short and my patch is
clearly emphasized.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-03-18 09:42
Message:
Logged In: YES
user_id=21627
If there are no further comments in favour of accepting this
patch, it will be rejected.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-02-27 23:13
Message:
Logged In: YES
user_id=21627
If it returns "My Documents", it is definitely *not* the
home directory of the user; \Documents and Settings\username
would be the home directory.
Furthermore, on many installations, HOME *is* set, and it is
the Administrator's choice where that points to; the typical
installation (in a domain) indeed is to assign HOMEDRIVE.
So I'm not in favour of that change.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=523424&group_id=5470