]> granicus.if.org Git - python/commit
bpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-5596)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 9 Feb 2018 11:56:50 +0000 (03:56 -0800)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 9 Feb 2018 11:56:50 +0000 (13:56 +0200)
commit0e361730b0954f7560640dd932f00f507e328c45
treea227f44872eb964e0d7f69612043b3a60eb89a69
parent105fcbfd6a91abea0ecd71e53651f39ad6f6039b
bpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-5596)

fnmatch.translate() no longer produces patterns which contain set
operations.

Sets starting with '[' or containing '--', '&&', '~~' or '||' will
be interpreted differently in regular expressions in future versions.
Currently they emit warnings. fnmatch.translate() now avoids producing
patterns containing such sets by accident.
(cherry picked from commit 23cdbfa744f0ec0e9e7575d378df4cb758691cd3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/fnmatch.py
Lib/test/test_fnmatch.py
Misc/NEWS.d/next/Library/2018-02-07-19-12-10.bpo-32775.-T77_c.rst [new file with mode: 0644]