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.

DeprecationWarning over invalid escape sequences

See original GitHub issue

elasticsearch-py version (elasticsearch.__versionstr__): master branch

Description of the problem including expected versus actual behavior:

DeprecationWarning over invalid escape sequences. Escaping them or using raw string literals is preferred.

Steps to reproduce:

find . -iname '*.py' | xargs -P 4 -I{} python3.8 -Wall -m py_compile {}

./elasticsearch-py/test_elasticsearch/test_connection.py:330: DeprecationWarning: invalid escape sequence \?
  "^GET http://localhost:9200/\?param=42 \[status:500 request:0.[0-9]{3}s\]",
./elasticsearch-py/test_elasticsearch/test_connection.py:356: DeprecationWarning: invalid escape sequence \[
  '#\[200\] \(0.[0-9]{3}s\)\n#\{\n#  "answer": "that\\\\u0027s it!"\n#\}',
./elasticsearch-py/test_elasticsearch/test_connection.py:365: DeprecationWarning: invalid escape sequence \?
  "GET http://localhost:9200/\?param=42 \[status:200 request:0.[0-9]{3}s\]",

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sethmlarsoncommented, Apr 22, 2020

Don’t think so, thank yall for this 😃

1reaction
alexk307commented, Feb 7, 2020

Thanks @sethmlarson, I wasn’t sure if 3.8 deprecated or just produced a deprecation warning for a future release.

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 >
Why does Python log a DeprecationWarning saying “invalid ...
The combination of \ plus a second character is called an escape sequence. The warning “invalid escape sequence” is telling you that you've ......
Read more >
Fix invalid escape sequence warning on python >=3.6 #680
Python 3.6 now throw warning for invalid escape sequences (https://bugs.python.org/issue27364). The string here contains invalid escapes ...
Read more >
Pythontex Warning: "DeprecationWarning: invalid escape ...
Python interprets \m as an escape sequence, which it is not. I think this can be fixed by making the documentation a raw...
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 >

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