-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-101100: Fix Sphinx warnings in library/tarfile.rst #113237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @hugovk. Thanks for fixing the warnings.
I wasn't sure if the backslashes were strictly needed in rST but the rendered version looks good.
@@ -795,8 +840,8 @@ A ``TarInfo`` object has the following public data attributes: | |||
|
|||
A dictionary containing key-value pairs of an associated pax extended header. | |||
|
|||
.. method:: TarInfo.replace(name=..., mtime=..., mode=..., linkname=..., | |||
uid=..., gid=..., uname=..., gname=..., | |||
.. method:: TarInfo.replace(name=..., mtime=..., mode=..., linkname=..., \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the backslashes necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the original doesn't render properly, we get a reference warning, and the earlier mention doesn't link to it:

https://docs.python.org/3/library/tarfile.html#tarfile.TarInfo.pax_headers
With them it's rendered properly, and the reference works properly:

Alternatively, we can remove the backticks, and make it a long, single line.
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @hugovk, I could not cleanly backport this to
|
Sorry, @hugovk, I could not cleanly backport this to
|
GH-113244 is a backport of this pull request to the 3.12 branch. |
GH-113245 is a backport of this pull request to the 3.11 branch. |
…ythonGH-113237) Fix Sphinx warnings in library/tarfile.rst (cherry picked from commit f428c4d) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
…ythonGH-113237) Fix Sphinx warnings in library/tarfile.rst (cherry picked from commit f428c4d) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
…13237) Fix Sphinx warnings in library/tarfile.rst
…13237) Fix Sphinx warnings in library/tarfile.rst
…13237) Fix Sphinx warnings in library/tarfile.rst
Fix 23 warnings:
Involved adding docs for a number of constants, based on the comments from the source:
cpython/Lib/tarfile.py
Lines 87 to 99 in cfa25fe
The order matches that in the source.
GNUTYPE_SPARSE
is referenced in the docs (and caused a warning),GNUTYPE_LONGNAME
andGNUTYPE_LONGLINK
are not; I added all three to docs.📚 Documentation preview 📚: https://cpython-previews--113237.org.readthedocs.build/en/113237/library/tarfile.html