austinbhale/clang-tidy-html

Python "invalid escape sequence" warnings

JoevDubach opened this issue · 0 comments

When I run clang_html with the -Wall option, it notices some problems:

site-packages/clang_html/clang_visualizer.py:328: DeprecationWarning: invalid escape sequence \/
  clang_check_url = clang_base_url.replace('/', '\/') + 'list.html'
site-packages/clang_html/clang_visualizer.py:371: DeprecationWarning: invalid escape sequence \/
  '/', '\/') + docs_check_name + '.html'

Indeed, these '\/' instances could be changed to '\\/' for the same effect while avoiding the warnings:

Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> '\/'
<stdin>:1: DeprecationWarning: invalid escape sequence \/
'\\/'
>>> '\\/'
'\\/'