question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecation warning due to invalid escape sequences

See original GitHub issue

Description

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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tirkarthicommented, Feb 11, 2020

I will raise a PR for this shortly.

1reaction
tirkarthicommented, Feb 11, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found