You get a Deprecation Warning for
'\\nRevision: (\d+)\\n'
because Python interprets \d
as invalid escape sequence. As is, Python doesn't substitute that sub-string, but warns about it since Version 3.6:
Unlike Standard C, all unrecognized escape sequences are left in the string unchanged, i.e., the backslash is left in the result. (This behavior is useful when debugging: if an escape sequence is mistyped, the resulting output is more easily recognized as broken.) It is also important to note that the escape sequences only recognized in string literals fall into the category of unrecognized escapes for bytes literals.
Changed in version 3.6: Unrecognized escape sequences produce a DeprecationWarning. In a future Python version they will be a SyntaxWarning and eventually a SyntaxError.
(source)
Thus, you can fix this warning by either escaping that back-slash properly or using raw strings.
That means, escape more:
'\\nRevision: (\\d+)\\n'
Or, use a raw string literal (where \
doesn't start an escape sequence):
r'\nRevision: (\d+)\n'