This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: BytesWarning in re module when compiling certain bytes patterns
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, ezio.melotti, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-07-10 23:27 by JelleZijlstra, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg298095 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2017-07-10 23:27
This code in sre_parse (line 738 and down):

                            warnings.warn(
                                'Flags not at the start of the expression %s%s' % (
                                    source.string[:20],  # truncate long regexes
                                    ' (truncated)' if len(source.string) > 20 else '',
                                ),
                                DeprecationWarning, stacklevel=7
                            )


triggers a BytesWarning if you do `_line_re = re.compile(br'^(.*?)$(?m)')`.

The fix should be simple; I can try to get a PR in over the next few days.
msg298100 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-11 02:11
Thank you for your report Jelle, but this was fixed in issue30605.
History
Date User Action Args
2022-04-11 14:58:48adminsetgithub: 75079
2017-07-11 02:11:08serhiy.storchakasetstatus: open -> closed
resolution: out of date
messages: + msg298100

stage: resolved
2017-07-10 23:27:55JelleZijlstracreate