[Patches] [ python-Patches-957650 ] Fix for bugs relating to
ntpath.expanduser()
SourceForge.net
noreply at sourceforge.net
Tue Jun 15 06:46:12 EDT 2004
Patches item #957650, was opened at 2004-05-20 21:35
Message generated for change (Comment added) made by mwh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=957650&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Josiah Carlson (josiahcarlson)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for bugs relating to ntpath.expanduser()
Initial Comment:
Attached is a patch for sf bug #796219 that fixes
ntpath.expanduser() for paths that embed other
environment variables, and also includes functionality
that mirrors *nix-style ~user\extra expansions.
I will comment with output from both the unpatched and
patched version of ntpath.
----------------------------------------------------------------------
>Comment By: Michael Hudson (mwh)
Date: 2004-06-15 11:46
Message:
Logged In: YES
user_id=6656
bugger, wrong report :-/
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2004-06-15 11:45
Message:
Logged In: YES
user_id=6656
This looks much better to me!
----------------------------------------------------------------------
Comment By: Josiah Carlson (josiahcarlson)
Date: 2004-06-15 02:11
Message:
Logged In: YES
user_id=341410
What problem is needed?
Perhaps you mean "this solution is desireable".
----------------------------------------------------------------------
Comment By: alan johnson (chomo)
Date: 2004-06-14 21:44
Message:
Logged In: YES
user_id=943591
this problem maybe is whats
needed
----------------------------------------------------------------------
Comment By: Josiah Carlson (josiahcarlson)
Date: 2004-05-20 21:38
Message:
Logged In: YES
user_id=341410
I uploaded the testing as text to alleviate text wrapping
issues that could confuse.
----------------------------------------------------------------------
Comment By: Josiah Carlson (josiahcarlson)
Date: 2004-05-20 21:36
Message:
Logged In: YES
user_id=341410
#test setup:
>>> import os
>>> os.environ['TESTING'] = '%TESTING1%'
>>> os.environ['TESTING1'] = '%TESTING2%'
>>> os.environ['TESTING2'] = 'Final\Path'
#test standard ntpath
>>> import ntpath
>>> ntpath.expanduser('~')
'C:\Documents and Settings\jcarlson'
>>> ntpath.expanduser('~billy')
'~billy'
>>> ntpath.expanduser('~billy\bob')
'~billy\bob'
>>> ntpath.expanduser('~\bob')
'C:\Documents and Settings\jcarlson\bob'
>>>
ntpath.expanduser('~billy\%TESTING%\%TESTING1%\%TESTING2%')
'~billy\%TESTING%\%TESTING1%\%TESTING2%'
#test patched ntpath
>>> import ntpath_patched
>>> ntpath_patched.expanduser('~')
'C:Documents and Settings\jcarlson'
>>> ntpath_patched.expanduser('~billy')
'C:Documents and Settings\billy'
>>> ntpath_patched.expanduser('~billy\bob')
'C:Documents and Settings\billy\bob'
>>> ntpath_patched.expanduser('~\bob')
'C:Documents and Settings\jcarlson\bob'
>>>
ntpath_patched.expanduser('~billy\%TESTING%\%TESTING1%\%TESTING2%')
'C:Documents and
Settings\billy\Final\Path\Final\Path\Final\Path'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=957650&group_id=5470
More information about the Patches
mailing list