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 josiahcarlson
Recipients
Date 2003-08-29.18:20:22
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=341410

The code you offered won't work correctly for all
environment variable returns.  An example that would kill
your code:
%SYSTEMROOT%\System32

def expandfull(var, rem=3):
    if not rem:
        return expandvars(var)
    a = expandvars(var)
    b = a.split('\\')
    c = []
    for i in b:
        if '%' in i:
            c.append(expandfull(i), rem-1)
        else:
            c.append(i)
    return '\\'.join(c)

The above would work properly for all environment variables.
History
Date User Action Args
2007-08-23 14:16:32adminlinkissue796219 messages
2007-08-23 14:16:32admincreate