Bugs item #1635353, was opened at 2007-01-14 12:28
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1635353&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Marien Zwart (marienz)
Assigned to: Nobody/Anonymous (nobody)
Summary: expanduser tests in test_posixpath fail if $HOME ends in a /

Initial Comment:
test_expanduser in test_posixpath checks if expanduser('~/') equals 
expanduser('~') + '/'. expanduser checks if the home dir location ends in a / 
and skips the first character of the appended path if it does (so 
expanduser('~/foo') with HOME=/spork/ becomes /spork/foo, not /spork//foo). 
This means that if you run test_posixpath with HOME=/spork/ expanduser('~') and 
expanduser('~/') both return '/spork/' and the test fails because '/spork//' != 
'/spork/'.

Possible fixes I can think of: either have expanduser strip the trailing slash 
from the home directory instead of skipping the first slash from the appended 
path (so still with HOME=/spork/ expanduser('~') would be '/spork'), or have 
the test check if expanduser('~') ends in a backslash and check if 
expanduser('~') is equal to expanduser('~/') in that case.

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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2007-01-18 22:00

Message:
Logged In: YES 
user_id=33168
Originator: NO

What version of Python and what platform (Windows? Unix? etc)?

I tried this on Linux with Python 2.5 and test_posixpath passed.

[EMAIL PROTECTED] ~/build/python/svn/r25 $ HOME=~/ ./python -tt
./Lib/test/regrtest.py test_posixpath
test_posixpath
1 test OK.

[EMAIL PROTECTED] ~/build/python/svn/r25 $ HOME=/home/neal//// ./python -tt
./Lib/test/regrtest.py test_posixpath
test_posixpath
1 test OK.


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1635353&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to