Skip to content

Deprecation warnings due to invalid escape sequences in python 3.8 #853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tirkarthi opened this issue Oct 11, 2020 · 4 comments
Closed
Labels
Milestone

Comments

@tirkarthi
Copy link

Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals. pyupgrade also helps in automatic conversion : https://github.com/asottile/pyupgrade/

I will raise a PR for this

find . -iname '*.py' | xargs -P4 -I{} python3 -Wall -m py_compile {} 
./bpython/line.py:193: DeprecationWarning: invalid escape sequence \s
  current_method_definition_name_re = LazyReCompile("def\s+([a-zA-Z_][\w]*)")
./bpython/cli.py:943: DeprecationWarning: invalid escape sequence \T
  elif key in ("KEY_NPAGE", "\T"):  # page_down or \T
./bpython/cli.py:947: DeprecationWarning: invalid escape sequence \S
  elif key in ("KEY_PPAGE", "\S"):  # page_up or \S
@sebastinas sebastinas added the bug label Oct 11, 2020
@sebastinas sebastinas added this to the release-0.20 milestone Oct 11, 2020
@thomasballinger
Copy link
Member

I tried to fix this sort of thing in Curtsies and had trouble: bpython/curtsies#128, I'll look at that again now.

@thomasballinger
Copy link
Member

Oh I see, that's easy

@thomasballinger
Copy link
Member

Two of these come from 0259cf8 and I'm not sure what the original intent was of checking for a curses key code like "\S" or "\T". I'm guessing they should be ^S and ^T, but ^S is usually already used for save. I'm going to remove these.

@sebastinas
Copy link
Contributor

Fixed in c9a8aa3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants