[issue32775] fnmatch.translate() can produce a pattern which emits a nested set warning

Serhiy Storchaka report at bugs.python.org
Mon Feb 5 15:17:38 EST 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It is easy to fix sets starting with '['. It is more hard to fix sets with doubled '-', '&', '|' or '~'.

>>> fnmatch.fnmatch('#', '[#--]')
/home/serhiy/py/cpython/Lib/fnmatch.py:46: FutureWarning: Possible set difference at position 6
  return re.compile(res).match
True

----------
assignee:  -> serhiy.storchaka
priority: normal -> high

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32775>
_______________________________________


More information about the Python-bugs-list mailing list