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 Tilka
Recipients Aquinas, Tilka, eric.smith,, kveretennicov, l0nwlf, terry.reedy
Date 2011-11-11.14:33:10
SpamBayes Score 0.218931
Marked as misclassified No
Message-id <>
As a workaround, it is possible to make every glob character a character set of one character (wrapping it with [] ). The gotcha here is that you can't just use multiple replaces because you would escape the escape brackets.

Here is a function adapted from [1]:

def escape_glob(path):
    transdict = {
            '[': '[[]',
            ']': '[]]',
            '*': '[*]',
            '?': '[?]',
    rc = re.compile('|'.join(map(re.escape, transdict)))
    return rc.sub(lambda m: transdict[], path)

Date User Action Args
2011-11-11 14:33:11Tilkasetrecipients: + Tilka, terry.reedy, eric.smith, kveretennicov, l0nwlf,, Aquinas
2011-11-11 14:33:11Tilkasetmessageid: <>
2011-11-11 14:33:11Tilkalinkissue8402 messages
2011-11-11 14:33:10Tilkacreate