Skip to content
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

Deprecation warning due to invalid escape sequences in Python 3.8 #37

Open
tirkarthi opened this issue Feb 9, 2020 · 1 comment
Open

Comments

@tirkarthi
Copy link

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 -Walways -m py_compile {}
./prettytable/prettytable.py:25: DeprecationWarning: invalid escape sequence \[
  _re = re.compile("\033\[[0-9;]*m")
./prettytable/prettytable.py:925: DeprecationWarning: invalid escape sequence \{
  self.vertical_char = random.choice("~!@#$%^&*()_+|-=\{}[];':\",./;<>?")
./prettytable/prettytable.py:926: DeprecationWarning: invalid escape sequence \{
  self.horizontal_char = random.choice("~!@#$%^&*()_+|-=\{}[];':\",./;<>?")
./prettytable/prettytable.py:927: DeprecationWarning: invalid escape sequence \{
  self.junction_char = random.choice("~!@#$%^&*()_+|-=\{}[];':\",./;<>?")
./prettytable/prettytable.py:424: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif val is None or (isinstance(val, dict) and len(val) is 0):
./prettytable/prettytable.py:444: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif val is None or (isinstance(val, dict) and len(val) is 0):
./prettytable/prettytable.py:462: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if val is None or (isinstance(val, dict) and len(val) is 0):
./prettytable/prettytable.py:492: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if val is None or (isinstance(val, dict) and len(val) is 0):
./prettytable/prettytable.py:690: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if val is None or (isinstance(val, dict) and len(val) is 0):
./prettytable/prettytable.py:707: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if val is None or (isinstance(val, dict) and len(val) is 0):
@hugovk
Copy link
Contributor

hugovk commented Nov 1, 2020

Tip: this is fixed in upstream PrettyTable.

https://github.com/jazzband/prettytable

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

No branches or pull requests

2 participants