petl-developers/petl

Deprecation warning due to invalid escape sequences

Closed this issue · 0 comments

Minimal, reproducible code sample, a copy-pastable example if possible

find . -iname '*.py' | grep -v example | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./petl/util/base.py:662: DeprecationWarning: invalid escape sequence \{
  prog = re.compile('\{([^}]+)\}')

Problem description

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/

Version and installation information

  • Value of petl.__version__ : master
  • Version information for any third-party package dependencies that are relevant
  • Version of Python interpreter : 3.8
  • Operating system (Linux/Windows/Mac) Linux
  • How petl was installed (e.g., "using pip into virtual environment", or "using conda")

Thanks!