[docs] [issue8402] Add a way to escape metacharacters in glob/fnmatch

Serhiy Storchaka report at bugs.python.org
Mon Oct 15 09:38:07 CEST 2012


Serhiy Storchaka added the comment:

> The attached patch adds support for '\\' escaping to fnmatch, and consequently to glob.

This is a backward incompatible change. For example glob.glob(r'C:\Program Files\*') will be broken.

As flacs says a way to escape metacharacters in glob/fnmatch already exists. If someone want to match literal name "Ajax_[version2].txt" it should use pattern "Ajax_[[]version2].txt". Documentation should explicitly mentions such way.

It will be good also to add new fnmatch.escape() function.

----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8402>
_______________________________________


More information about the docs mailing list