Documentation | Draft: waf: Fix Python warnings (!103)
Frank Kuehndel (@frank_k)
gitlab at rtems.org
Wed Dec 18 21:24:11 UTC 2024
Frank Kuehndel created a merge request: https://gitlab.rtems.org/rtems/docs/rtems-docs/-/merge_requests/103
Project:Branches: frank_k/rtems-docs:fix-python-warnings to rtems/docs/rtems-docs:main
Author: Frank Kuehndel
## 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
<!-- Default settings, if it is a dropdown it will set after submission -->
--
View it on GitLab: https://gitlab.rtems.org/rtems/docs/rtems-docs/-/merge_requests/103
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20241218/6a62fc9c/attachment-0001.htm>
More information about the bugs
mailing list