Repository navigation
Conversation
The reST plural trick :class:`X`\s was written as "\s" in regular (non-raw) docstrings. Python keeps the backslash today but emits a SyntaxWarning on import, an error under -W error, and has said these will stop working in a future version. Doubling the backslash produces byte-identical docstrings, so the rendered docs do not change. Signed-off-by: Kevin Turcios <turcioskevinr@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing
tensorrt.pluginprints nineSyntaxWarning: "\s" is an invalid escape sequencelines on Python 3.12+. Under-W errorthe import fails outright. The source is the reST plural idiom:class:`X`\sinside regular (non-raw) docstrings in_lib.py,_tensor.pyand_top_level.py.This doubles the backslash (
\s→\\s). Python already keeps the backslash for an unrecognized escape, so the docstrings are byte-identical before and after, and the Sphinx output doesn't change.Checked with CPython 3.15.0:
compile(..., -W error)fails withSyntaxError: "\s" is an invalid escape sequence.-W error.ast) are identical before and after.Found while building and testing the bindings for Python 3.15 (#4890).