[Patches] [ python-Patches-957650 ] Fix for bugs relating to ntpath.expanduser()

SourceForge.net noreply at sourceforge.net
Thu Jan 13 06:51:46 CET 2005


Patches item #957650, was opened at 2004-05-20 15:35
Message generated for change (Settings changed) made by kbk
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: Kurt B. Kaiser (kbk)
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 05:46

Message:
Logged In: YES 
user_id=6656

bugger, wrong report :-/

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

Comment By: Michael Hudson (mwh)
Date: 2004-06-15 05:45

Message:
Logged In: YES 
user_id=6656

This looks much better to me!

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

Comment By: Josiah Carlson (josiahcarlson)
Date: 2004-06-14 20: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 15:44

Message:
Logged In: YES 
user_id=943591

this problem maybe is whats
needed

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

Comment By: Josiah Carlson (josiahcarlson)
Date: 2004-05-20 15: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 15: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