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 pancake
Recipients pancake
Date 2009-03-10.19:16:12
SpamBayes Score 2.647558e-09
Marked as misclassified No
Message-id <1236712575.55.0.379860744016.issue5471@psf.upfronthosting.co.za>
In-reply-to
Content
When the HOME path is just '/' python says that the home path is ""
(zero length string)

I was able to reproduce this issue in 2.5.2 and 2.6 (no idea about 3.0)

Here's an example:

$ HOME=/ python -c 'import os;print os.path.expanduser("~")'

$ HOME=/tmp python -c 'import os;print os.path.expanduser("~")'
/tmp

$ HOME=a python -c 'import os;print os.path.expanduser("~")'
a

------8<----------

I just used "if !os.path.isdir(os.path.expanduser('~')):" check in
my application to avoid messing around the resulting paths when the
application runs.

The correct response should be '/' instead of ''.
History
Date User Action Args
2009-03-10 19:16:15pancakesetrecipients: + pancake
2009-03-10 19:16:15pancakesetmessageid: <1236712575.55.0.379860744016.issue5471@psf.upfronthosting.co.za>
2009-03-10 19:16:13pancakelinkissue5471 messages
2009-03-10 19:16:12pancakecreate