[Python-bugs-list] [ python-Bugs-442712 ] os.path.expanduser problem w/o HOME set

noreply@sourceforge.net noreply@sourceforge.net
Thu, 19 Jul 2001 05:45:58 -0700


Bugs item #442712, was opened at 2001-07-19 04:05
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442712&group_id=5470

Category: Windows
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Tim Peters (tim_one)
Summary: os.path.expanduser problem w/o HOME set

Initial Comment:
If I do a os.path.expanduser("~") I get '\Documents
and Settings\kwg' - the C: drive is not mentioned.
I traced this to the call to join (and onwards to the
isabs call in the code for the join function.
Simple remedy is to use
userhome = drive + os.environ['HOMEPATH']
instead of 
userhome = join(drive, os.environ['HOMEPATH']

My sys.version value is
'2.1 (#15, Apr 16 2001, 18:24:49) [MSC 32 bit (Intel]'

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-07-19 05:45

Message:
Logged In: YES 
user_id=6380

Hm, but why doesn't the join() work?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442712&group_id=5470