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.

Author serhiy.storchaka
Recipients Tim.Graham, abarry, eric.smith, ezio.melotti, martin.panter, ncoghlan, ned.deily, petr.viktorin, r.david.murray, rhettinger, serhiy.storchaka, yan12125, yselivanov
Date 2016-10-31.12:36:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477917367.46.0.0620395401845.issue28128@psf.upfronthosting.co.za>
In-reply-to
Content
Following patch just raises SyntaxError if DeprecationWarning was raised as error. Still needed tests for this.

> Also, you'll note that with or without your patch, you get the same behavior.

Not the same. New warnings contain correct information about a file and a line.

$ ./python-unpatched -Wa escape_warning.py
_frozen_importlib:205: DeprecationWarning: invalid escape sequence '\d'
\d

$ ./python-patched -Wa escape_warning.py
/home/serhiy/py/cpython-3.6/bad_escape.py:2: DeprecationWarning: invalid escape sequence \d
  print('\d')
\d

$ ./python-unpatched -We escape_warning.py
Traceback (most recent call last):
  File "escape_warning.py", line 1, in <module>
    import bad_escape
DeprecationWarning: invalid escape sequence '\d'

$ ./python-patched -We escape_warning.py
Traceback (most recent call last):
  File "escape_warning.py", line 1, in <module>
    import bad_escape
  File "/home/serhiy/py/cpython-3.6/bad_escape.py", line 2
    print('\d')
         ^
SyntaxError: invalid escape sequence \d
History
Date User Action Args
2016-10-31 12:36:07serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, ncoghlan, eric.smith, ned.deily, ezio.melotti, r.david.murray, petr.viktorin, martin.panter, yselivanov, Tim.Graham, yan12125, abarry
2016-10-31 12:36:07serhiy.storchakasetmessageid: <1477917367.46.0.0620395401845.issue28128@psf.upfronthosting.co.za>
2016-10-31 12:36:07serhiy.storchakalinkissue28128 messages
2016-10-31 12:36:07serhiy.storchakacreate