Skip to content

waf: Fix Python warnings

Frank Kuehndel requested to merge frank_k/rtems-docs:fix-python-warnings into main

Summary

waf: Fix Python warnings

rtems-docs/common/waf.py:111: SyntaxWarning: invalid escape sequence '\D'
  ver = tuple(map(int, re.split('[\D]', version)))
rtems-docs/common/waf.py:118: SyntaxWarning: invalid escape sequence '\D'
  ver = tuple(map(int, re.split('[\D]', version)))
rtems-docs/common/waf.py:418: SyntaxWarning: invalid escape sequence '\?'
  no_hash = re.sub(b'\?v=[a-z0-9]{8}', b'', fp.read())
rtems-docs/common/waf.py:419: SyntaxWarning: invalid escape sequence '\?'
  no_digest = re.sub(b'\?digest=[a-z0-9]{20}', b'', no_hash)
rtems-docs/common/latex.py:9: SyntaxWarning: invalid escape sequence '\d'
  '\documentclass[a4paper,11pt,english]{report}']

Basically, Python keeps wrong \ but prints a warning. Using "raw" strings with re (regular expressions) is recommended. What raises some doubts is the use of "binary" strings with re. Yet, these were already in the original code.

Close #58 (closed)

Merge request reports