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 jdufresne
Recipients jdufresne
Date 2017-04-17.17:19:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-04-17 17:19:05jdufresnesetrecipients: + jdufresne
2017-04-17 17:19:05jdufresnesetmessageid: <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za>
2017-04-17 17:19:05jdufresnelinkissue30091 messages
2017-04-17 17:19:05jdufresnecreate