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 johahn
Recipients
Date 2003-10-20.18:26:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=887415

Hi Jeremy


   The purpose of path.expandvars is to retrieve environment 
variables in a platform independant way into a user supplied 
string, as in path.expandvars('$PYTHON/Lib/site-packages'). 
Using %vars% on windows and $vars on unix would make the 
method pointless. So this is no bug, though it might be 
explained a little vague in the docstring (IMHO the overall 
purpose and the phrase "left unchanged" are both unclear):


>>> help(path.expandvars)


Help on function expandvars in module ntpath:


expandvars(path)


    Expand shell variables of form $var and ${var}.


    Unknown variables are left unchanged.




   Though, the module docs offer a better explanation:


"Return the argument with environment variables expanded. 
Substrings of the form "$name" or "${name}" are replaced by 
the value of environment variable name. Malformed variable 
names and references to non-existing variables are left 
unchanged. On the Macintosh, this always returns path 
unchanged."




   Still, what does "unchanged" mean? On my windows system 
non-existing variables are IGNORED, they are not left 
unchanged anywhere:


>>> path.expandvars('$MADEUP/Lib/site-packages')


'/Lib/site-packages'




   Is it me or is that a bug? :)




...johahn
History
Date User Action Args
2007-08-23 14:17:42adminlinkissue824371 messages
2007-08-23 14:17:42admincreate