Skip to content

bpo-32775: Fix regular expression warnings in fnmatch.#5583

Merged
serhiy-storchaka merged 1 commit intopython:masterfrom
serhiy-storchaka:fnmatch-translate-warnings
Feb 9, 2018
Merged

bpo-32775: Fix regular expression warnings in fnmatch.#5583
serhiy-storchaka merged 1 commit intopython:masterfrom
serhiy-storchaka:fnmatch-translate-warnings

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Feb 7, 2018

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.

https://bugs.python.org/issue32775

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.
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.7 labels Feb 7, 2018
@serhiy-storchaka serhiy-storchaka merged commit 23cdbfa into python:master Feb 9, 2018
@bedevere-bot
Copy link

@serhiy-storchaka: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the fnmatch-translate-warnings branch February 9, 2018 11:30
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 9, 2018
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 23cdbfa)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-5596 is a backport of this pull request to the 3.7 branch.

serhiy-storchaka added a commit that referenced this pull request Feb 9, 2018
…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 23cdbfa)

Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants