[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset a1aef5f84142 by Serhiy Storchaka in branch '3.5': Issue #22949: Documented that fnmatch.translate() is for use with re.match(). https://hg.python.org/cpython/rev/a1aef5f84142 New changeset 8a564ab1d208 by Serhiy Storchaka in branch '2.7': Issue

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file45116/doc_fnmatch_translate.patch ___ Python tracker

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since issue22493 fnmatch.translate() uses scoped modifiers: r'(?s:%s)\Z' % res. Here is a patch that updates the documentation for fnmatch.translate(). -- stage: needs patch -> patch review versions: +Python 3.6, Python 3.7 -Python 3.4

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread mstol
New submission from mstol: I'm not sure if this is real bug, but the documentation of fnmatch.translate states: fnmatch.translate(pattern) Return the shell-style pattern converted to a regular expression. My intuition about shell-style pattern is that for example, pattern:t3 should

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread mstol
mstol added the comment: it can be changed easyly with changing the return statement in fnmatch.py function translate from: return res + '\Z(?ms)' to: return '^' + res + '\Z(?ms)' -- ___ Python tracker rep...@bugs.python.org

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The result of fnmatch.translate() is used with re.match(). It could be even simplified if use it with re.fullmatch(), but I afraid such change can break user code. -- nosy: +serhiy.storchaka ___ Python tracker

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread mstol
mstol added the comment: So you suggest that this output should not be used with re.search ? Why? I think it should be documented, or maybe it is? I know that this is not possible to introduce such a change to the currently used versions. -- ___

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it should be documented. -- assignee: - docs@python components: +Documentation keywords: +easy nosy: +docs@python priority: normal - low stage: - needs patch versions: +Python 3.4, Python 3.5 ___ Python

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2014-11-26 Thread Matthew Barnett
Matthew Barnett added the comment: I notice that it puts the inline flags at the end. It would be better to put them at the start. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22949 ___