Skip to content

Deprecation warning due to invalid escape sequences in Python 3.7 #124

Description

@tirkarthi

Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals.

find . -iname '*.py' | grep -v example | xargs -P 4 -I{} python3.8 -Wall -m py_compile {} 
./teradata/util.py:311: DeprecationWarning: invalid escape sequence \*
  tokens = re.split("(--|'|\n|" + re.escape(delimiter) + "|\"|/\*|\*/)",
./teradata/util.py:356: DeprecationWarning: invalid escape sequence \*
  tokens = re.split("(--|'|" + re.escape(newline) + "|\"|/\*|\*/)",
./teradata/datatypes.py:38: DeprecationWarning: invalid escape sequence \d
  scalarIntervalRegEx = re.compile("^(-?)(\d+)$")
./teradata/datatypes.py:39: DeprecationWarning: invalid escape sequence \d
  yearToMonthIntervalRegEx = re.compile("^(-?)(\d+)-(\d+)$")
./teradata/datatypes.py:40: DeprecationWarning: invalid escape sequence \d
  dayToHourIntervalRegEx = re.compile("^(-?)(\d+) (\d+)$")
./teradata/datatypes.py:41: DeprecationWarning: invalid escape sequence \d
  dayToMinuteIntervalRegEx = re.compile("^(-?)(\d+) (\d+):(\d+)$")
./teradata/datatypes.py:42: DeprecationWarning: invalid escape sequence \d
  dayToSecondIntervalRegEx = re.compile("^(-?)(\d+) (\d+):(\d+):(\d+\.?\d*)$")
./teradata/datatypes.py:43: DeprecationWarning: invalid escape sequence \d
  hourToMinuteIntervalRegEx = re.compile("^(-?)(\d+):(\d+)$")
./teradata/datatypes.py:44: DeprecationWarning: invalid escape sequence \d
  hourToSecondIntervalRegEx = re.compile("^(-?)(\d+):(\d+):(\d+\.?\d*)$")
./teradata/datatypes.py:45: DeprecationWarning: invalid escape sequence \d
  minuteToSecondIntervalRegEx = re.compile("^(-?)(\d+):(\d+\.?\d*)$")
./teradata/datatypes.py:46: DeprecationWarning: invalid escape sequence \d
  secondIntervalRegEx = re.compile("^(-?)(\d+\.?\d*)$")
./teradata/datatypes.py:47: DeprecationWarning: invalid escape sequence \(
  periodRegEx1 = re.compile("\('(.*)',\s*'(.*)'\)")
./teradata/datatypes.py:48: DeprecationWarning: invalid escape sequence \(
  periodRegEx2 = re.compile("ResultStruct:PERIOD\(.*\)\[(.*),\s*(.*)\]")
./teradata/pulljson.py:76: DeprecationWarning: invalid escape sequence \[
  self.pattern = re.compile('([\[\]{}:\\\\",])')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions