Skip to content

Pyren3, SyntaxWarning: invalid escape sequence '\ '

Pyren3, SyntaxWarning: invalid escape sequence '\ '

I see issue #91 (closed) also with:
Python version: Python 3.12.4
PyRen3 commit: fcc34349 (February 25, 2024 at 2:35:03 PM GMT+1)

This is a warning introduced in Python 3.12 to prepare for a future restriction.
https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes

See also:
https://github.com/HandBrake/HandBrake/issues/5454

C:\pyren-pyren3\main.py:430: SyntaxWarning: invalid escape sequence '\ ' self.root.option_add('*Dialog.msg.font', 'Courier\ New 12')

I have seen this warning also for other pyren files.

  pattern = pattern.replace('*', '\d{3}')
C:\pyren-pyren3\pyren3\mod_db_manager.py:218: SyntaxWarning: invalid escape sequence '\('
  pattern = pattern.replace('(','\(')
C:\pyren-pyren3\pyren3\mod_db_manager.py:220: SyntaxWarning: invalid escape sequence '\)'
  pattern = pattern.replace(')', '\)')
C:\pyren-pyren3\pyren3\mod_elm.py:628: SyntaxWarning: invalid escape sequence '\D'
  version_number = int(''.join([re.sub('\D', '', version) for version in firmware_version]))```