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

2013-11-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Eric's comment.

--
Added file: http://bugs.python.org/file32687/glob_escape_3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-18 Thread Eric V. Smith

Eric V. Smith added the comment:

Looks good to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5fda36bff39d by Serhiy Storchaka in branch 'default':
Issue #8402: Added the escape() function to the glob module.
http://hg.python.org/cpython/rev/5fda36bff39d

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Ezio and Eric for your reviews.

--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could anyone please review the patch before feature freeze?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-17 Thread Michele OrrĂ¹

Changes by Michele OrrĂ¹ maker...@gmail.com:


--
nosy:  -maker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Ezio's and Eric's comments.

--
Added file: http://bugs.python.org/file32673/glob_escape_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-06-13 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-03-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Escaping for glob on Windows should not be such trivial. Special characters in 
the drive part have no special meaning and should not be escaped. I.e. 
``escape('//?/c:/Quo vadis?.txt')`` should return ``'//?/c:/Quo 
vadis[?].txt'``. Perhaps we should move the escape function to the glob module 
(because it is glob's peculiarity).

Here is a patch for glob.escape().

--
Added file: http://bugs.python.org/file29380/glob_escape.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-03-07 Thread Matthew Barnett

Matthew Barnett added the comment:

I've attached fnmatch_implementation.py, which is a simple pure-Python 
implementation of the fnmatch function.

It's not as susceptible to catastrophic backtracking as the current re-based 
one. For example:

fnmatch('a' * 50, '*a*' * 50)

completes quickly.

--
nosy: +mrabarnett
Added file: http://bugs.python.org/file29343/fnmatch_implementation.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-03-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think it should be a separate issue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-12-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is good, if stdlib has function for escaping any special characters, even if 
this function is simple. There are already escape functions for re and 
sgml/xml/html.

Private function glob.glob1 used in Lib/msilib and Tools/msi to prevent 
unexpected globbing in parent directory name. ``glob.glob1(dirname, pattern)`` 
should be replaced by ``glob.glob(os.path.join(fnmatch.escape(dirname), 
pattern)`` in external code.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-11-17 Thread Ezio Melotti

Ezio Melotti added the comment:

The workaround is now documented.
I'm still not sure if this should still be added, or if it should be closed as 
rejected now that the workaround is documented.
A third option would be adding it as a recipe in the doc, given that the whole 
functions boils down to a single re.sub (the user can take care of picking the 
bytes/str regex depending on his input).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-11-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee: docs@python - 
components:  -Documentation
keywords: +needs review
resolution: invalid - 
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
title: Add a way to escape metacharacters in glob/fnmatch - Add a function to 
escape metacharacters in glob/fnmatch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com