Deprecation warning due to invalid escape sequences
See original GitHub issueDescription
Deprecation warnings are raised due to invalid escape sequences in Python 3.8 . Below is a log of the warnings raised during compiling all the python files. Using raw strings or escaping them will fix this issue.
find . -iname '*.py' | xargs -P 4 -I{} python -Wall -m py_compile {}
./tests/unit/lib/schemas/test_schemas_api_caller.py:233: DeprecationWarning: invalid escape sequence \/
"Content": '{"components":{"schemas":{"Some\/Awesome\/Schema.Object.1":{"type":"object","required":["foo","bar","baz"],"properties":{"foo":{"type":"string"},'
./tests/unit/lib/schemas/test_schemas_api_caller.py:234: DeprecationWarning: invalid escape sequence \/
'"bar":{"type":"string"},"baz":{"type":"string"}}},"Some\/Awesome\/Schema.Object$2":{"type":"object","required":["foo","bar","baz"],'
./tests/integration/init/schemas/schemas_test_data_setup.py:172: DeprecationWarning: invalid escape sequence \/
'"$ref":"#\/components\/schemas\/aws.partner\/mongodb.com\/Ticket.Created"},"detail-type":{"type":"string"},"resources":{"type":"array",'
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
invalid escape sequence" in Python? - Stack Overflow
A backslash isn't valid when not followed by one of the valid escape sequences, and newer versions of Python print a deprecation warning....
Read more >Deprecation warning due to invalid escape sequences in ...
Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals.
Read more >Pythontex Warning: "DeprecationWarning: invalid escape ...
In that line a docstring starts that contains multiple unescaped backslashes leading to accidental escape sequences (not just \m , by the way)....
Read more >Fix DeprecationWarning: invalid escape sequence issues
Some regex strings contain invalid escape sequences for normal strings, causing newer version of Python to emit DeprecationWarning messages.
Read more >invalid escape sequence - what to use instead of \d? - YouTube
PYTHON : DeprecationWarning : invalid escape sequence - what to use instead of \d? [ Gift : Animated Search Engine ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will raise a PR for this shortly.
Yes, they were also present in Python 3.7 . In Python 3.8 they were made
SyntaxWarning
but got reverted later to deprecation warning since a lot of libraries were not fixed extending the deprecation period.