New submission from Jelle Zijlstra:

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.

----------
components: Library (Lib)
messages: 298095
nosy: Jelle Zijlstra, ezio.melotti, serhiy.storchaka
priority: normal
severity: normal
status: open
title: BytesWarning in re module when compiling certain bytes patterns
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30896>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to