Issue #1365 new

Invalid escape sequences

Andreas Kloeckner
created an issue

Using Python 3.6 with $PYTHONWARNINGS set to default, a lot of of warnings about invalid escape sequences are printed upon importing pygments:

/usr/lib/python3/dist-packages/pygments/lexers/jvm.py:260: DeprecationWarning: invalid escape sequence \d                                                                                                                                                                                                                                                                                                                                                                             [255/335]
  letter_letter_digit = u'%s(?:%s|\d)*' % (letter, letter)
/usr/lib/python3/dist-packages/pygments/lexers/jvm.py:692: DeprecationWarning: invalid escape sequence \w
  u'(?![\w!:?])', Name.Function),
/usr/lib/python3/dist-packages/pygments/lexers/jvm.py:1261: DeprecationWarning: invalid escape sequence \w
  ('`?[a-zA-Z_][\w$]*', Name),
/usr/lib/python3/dist-packages/pygments/lexers/ruby.py:406: DeprecationWarning: invalid escape sequence \(
  _prompt_re = re.compile('irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] '
/usr/lib/python3/dist-packages/pygments/lexers/ruby.py:407: DeprecationWarning: invalid escape sequence \?
  '|>> |\?> ')
/usr/lib/python3/dist-packages/pygments/lexers/ruby.py:501: DeprecationWarning: invalid escape sequence \w
  ('[A-Z]\w*', Name.Constant),
/usr/lib/python3/dist-packages/pygments/lexers/ruby.py:502: DeprecationWarning: invalid escape sequence \w
  ('@[a-zA-Z_]\w*', Name.Variable.Instance),
/usr/lib/python3/dist-packages/pygments/lexers/ruby.py:503: DeprecationWarning: invalid escape sequence \w
  ('@@[a-zA-Z_]\w*', Name.Variable.Class),
/usr/lib/python3/dist-packages/pygments/lexers/ruby.py:505: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
/usr/lib/python3/dist-packages/pygments/lexers/actionscript.py:128: DeprecationWarning: invalid escape sequence \.
  typeidentifier = identifier + '(?:\.<\w+>)?'
/usr/lib/python3/dist-packages/pygments/lexers/actionscript.py:235: DeprecationWarning: invalid escape sequence \s
  ('\s+', Text),
/usr/lib/python3/dist-packages/pygments/lexers/php.py:176: DeprecationWarning: invalid escape sequence \}
  (r'\$\{\$+' + _ident_inner + '\}', Name.Variable),
/usr/lib/python3/dist-packages/pygments/lexers/php.py:217: DeprecationWarning: invalid escape sequence \[
  (r'\$' + _ident_inner + '(\[\S+?\]|->' + _ident_inner + ')?',
/usr/lib/python3/dist-packages/pygments/lexers/webmisc.py:441: DeprecationWarning: invalid escape sequence \(
  (r'(' + qname + ')(\()?', bygroups(Name, Punctuation), 'operator'),
/usr/lib/python3/dist-packages/pygments/lexers/webmisc.py:646: DeprecationWarning: invalid escape sequence \*
  (ncname + ':\*', Name, 'operator'),
/usr/lib/python3/dist-packages/pygments/lexers/webmisc.py:647: DeprecationWarning: invalid escape sequence \*
  ('\*:'+ncname, Name.Tag, 'operator'),
/usr/lib/python3/dist-packages/pygments/lexers/webmisc.py:648: DeprecationWarning: invalid escape sequence \*
  ('\*', Name.Tag, 'operator'),
/usr/lib/python3/dist-packages/pygments/lexers/webmisc.py:875: DeprecationWarning: invalid escape sequence \`
  """
/usr/lib/python3/dist-packages/pygments/lexers/lisp.py:142: DeprecationWarning: invalid escape sequence \(
  ("(?<=\()(%s)" % '|'.join(re.escape(entry) + ' ' for entry in builtins),
/usr/lib/python3/dist-packages/pygments/lexers/lisp.py:324: DeprecationWarning: invalid escape sequence \s
  (r'#+nil' + terminated + '\s*\(', Comment.Preproc, 'commented-form'),
/usr/lib/python3/dist-packages/pygments/lexers/lisp.py:336: DeprecationWarning: invalid escape sequence \*
  (r'\*' + symbol + '\*', Name.Variable.Global),
/usr/lib/python3/dist-packages/pygments/lexers/lisp.py:2157: DeprecationWarning: invalid escape sequence \*
  (r'\*' + symbol + '\*', Name.Variable.Global),
/usr/lib/python3/dist-packages/pygments/lexers/python.py:183: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
/usr/lib/python3/dist-packages/pygments/lexers/python.py:187: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Function, '#pop'),
/usr/lib/python3/dist-packages/pygments/lexers/python.py:191: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Class, '#pop')
/usr/lib/python3/dist-packages/pygments/lexers/python.py:268: DeprecationWarning: invalid escape sequence \w
  '((\w+)((\.\w+)|(\[[^\]]+\]))*)?'  # field name
/usr/lib/python3/dist-packages/pygments/lexers/python.py:269: DeprecationWarning: invalid escape sequence \!
  '(\![sra])?'                       # conversion
/usr/lib/python3/dist-packages/pygments/lexers/python.py:270: DeprecationWarning: invalid escape sequence \:
  '(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?'
/usr/lib/python3/dist-packages/pygments/lexers/python.py:271: DeprecationWarning: invalid escape sequence \}
  '\}', String.Interpol),
/usr/lib/python3/dist-packages/pygments/lexers/python.py:674: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
/usr/lib/python3/dist-packages/pygments/lexers/python.py:677: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Function, '#pop')
/usr/lib/python3/dist-packages/pygments/lexers/python.py:694: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Class, '#pop')
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:211: DeprecationWarning: invalid escape sequence \s
  if re.search('(?:my|our)\s+[$@%(]', text):
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:229: DeprecationWarning: invalid escape sequence \w
  PERL6_IDENTIFIER_RANGE = "['\w:-]"
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:498: DeprecationWarning: invalid escape sequence \s
  (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?',
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:594: DeprecationWarning: invalid escape sequence \s
  if re.search("(?:my|our|has)\s+(?:" + Perl6Lexer.PERL6_IDENTIFIER_RANGE +
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:595: DeprecationWarning: invalid escape sequence \s
  "+\s+)?[$@%&(]", text):
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:601: DeprecationWarning: invalid escape sequence \s
  if re.match('^\s*$', line):
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:605: DeprecationWarning: invalid escape sequence \s
  if re.match('^\s*(?:use\s+)?v6(?:\.\d(?:\.\d)?)?;', line):
/usr/lib/python3/dist-packages/pygments/lexers/perl.py:608: DeprecationWarning: invalid escape sequence \s
  class_decl = re.match('^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
/usr/lib/python3/dist-packages/pygments/lexers/iolang.py:52: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
/usr/lib/python3/dist-packages/pygments/lexers/scripting.py:107: DeprecationWarning: invalid escape sequence \(
  ('\(', Punctuation, '#pop'),
/usr/lib/python3/dist-packages/pygments/lexers/scripting.py:699: DeprecationWarning: invalid escape sequence \(
  ('\(\*', Comment.Multiline, '#push'),
/usr/lib/python3/dist-packages/pygments/lexers/scripting.py:700: DeprecationWarning: invalid escape sequence \*
  ('\*\)', Comment.Multiline, '#pop'),

Comments (0)

  1. Log in to comment