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

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated (thanks Ezio for review and comments). -- Added file: http://bugs.python.org/file27582/fnmatch_escape_2.patch ___ Python tracker

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

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I think the escaping workaround should be documented in the glob and/or > fnmatch docs. See issue16240. This issue left for enhancement. -- ___ Python tracker

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

2012-10-15 Thread Ezio Melotti
Ezio Melotti added the comment: I think the escaping workaround should be documented in the glob and/or fnmatch docs. This way users can simply do: import glob glob.glob("c:\abc\afolderwith[[]test]\*") rather than import glob import fnmatch glob.glob(fnmatch.escape("c:\abc\afolderwith[test]\

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

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure if escape() should support bytes. translate() doesn't. -- ___ Python tracker ___ ___

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

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which add fnmatch.escape() function. -- Added file: http://bugs.python.org/file27579/fnmatch_escape.patch ___ Python tracker __

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

2012-10-15 Thread Serhiy Storchaka
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 alr

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

2012-10-14 Thread Michele Orrù
Michele Orrù added the comment: Noblesse oblige :) -- Added file: http://bugs.python.org/file27570/issue8402.1.patch ___ Python tracker ___ ___

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

2012-10-14 Thread Éric Araujo
Éric Araujo added the comment: I have comments on the patch but a review link does not appear. Could you update your clone to latest default revision and regenerate the patch? Thanks. -- nosy: +eric.araujo title: glob returns empty list with "[" character in the folder name -> Add a