New submission from Paul Sokolovsky:

fnmatch.translate() ends with:

return res + '\Z(?ms)'

However, https://docs.python.org/3.4/library/re.html#regular-expression-syntax 
states:

Note that the (?x) flag changes how the expression is parsed. It should be used 
first in the expression string, or after one or more whitespace characters. If 
there are non-whitespace characters before the flag, the results are undefined.

Hence, fnmatch uses undefined pattern, and indeed, it fails with alternative 
Perl-compatible regular expression implementations (specifically, PCRE, which 
appear to do something like apply flag at the point of its occurrence).

----------
components: Library (Lib)
messages: 218198
nosy: pfalcon
priority: normal
severity: normal
status: open
title: fnmatch module uses undefined regular expression to perform matching
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21464>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to