[issue30067] _osx_support.py: misplaced flags in re.sub()

Jakub Wilk report at bugs.python.org
Thu Apr 13 16:04:13 EDT 2017


New submission from Jakub Wilk:

Lib/_osx_support.py contains the following line:

    flags = re.sub(r'-arch\s+\w+\s', ' ', flags, re.ASCII)

But the 4th re.sub() argument is the maximum number of substitutions, so this is equivalent to:

    flags = re.sub(r'-arch\s+\w+\s', ' ', flags, count=256)

It was probably meant to be:

    flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII)


This bug was found using pydiatra:
http://jwilk.net/software/pydiatra

----------
components: Library (Lib)
messages: 291631
nosy: jwilk
priority: normal
severity: normal
status: open
title: _osx_support.py: misplaced flags in re.sub()

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30067>
_______________________________________


More information about the Python-bugs-list mailing list