New submission from Jon Dufresne: After upgrading to Python 3.6, I'm working towards cleaning up "DeprecationWarning: invalid escape sequence". I've noticed that the Deprecation warning only appears on the first run. It looks like once the code is compiled to `__pycache__`, the deprecation warning does not show. This makes debugging more difficult as I need clean out `__pycache__` directories for the runs to be reproducible.
Example script: foo.py ``` import bar ``` bar.py ``` s = '\.' ``` First run ``` $ python36 -Wall foo.py .../test/bar.py:1: DeprecationWarning: invalid escape sequence \. s = '\.' ``` Second run (no DeprecationWarning) ``` $ python36 -Wall foo.py ``` Third run after cleaning ``` $ rm -rf __pycache__ $ python36 -Wall foo.py .../test/bar.py:1: DeprecationWarning: invalid escape sequence \. s = '\.' ``` I expect the deprecation warning to output on every run. ---------- components: Interpreter Core messages: 291805 nosy: jdufresne priority: normal severity: normal status: open title: DeprecationWarning: invalid escape sequence: Only appears on first run type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30091> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com