Skip to content

Conversation

@hugovk
Copy link
Member

@hugovkhugovk commented Dec 17, 2023

Fix 23 warnings:

SPHINXERRORHANDLING=-n PATH=./venv/bin:$PATH sphinx-build -b html -d buildDoctrees -j auto -n . build/html library/tarfile.rst 2>&1| grep WARNING | tee >(wc -l)Doc/library/tarfile.rst:115: WARNING: py:meth reference target not found: readDoc/library/tarfile.rst:115: WARNING: py:meth reference target not found: writeDoc/library/tarfile.rst:326: WARNING: py:attr reference target not found: nameDoc/library/tarfile.rst:361: WARNING: py:attr reference target not found: ~TarFile.errorlevelDoc/library/tarfile.rst:648: WARNING: py:meth reference target not found: !TarFile.getmemberDoc/library/tarfile.rst:648: WARNING: py:meth reference target not found: !TarFile.getmembersDoc/library/tarfile.rst:648: WARNING: py:meth reference target not found: TarInfo.replaceDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: REGTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: AREGTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: LNKTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: SYMTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: DIRTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: FIFOTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: CONTTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: CHRTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: BLKTYPEDoc/library/tarfile.rst:730: WARNING: py:const reference target not found: GNUTYPE_SPARSEDoc/library/tarfile.rst:740: WARNING: py:const reference target not found: LNKTYPEDoc/library/tarfile.rst:740: WARNING: py:const reference target not found: SYMTYPEDoc/library/tarfile.rst:819: WARNING: py:class reference target not found: TarinfoDoc/library/tarfile.rst:954: WARNING: py:const reference target not found: stat.S_IWGRP`|:const:`~stat.S_IWOTHDoc/library/tarfile.rst:979: WARNING: py:const reference target not found: stat.S_IRUSR`|:const:`~stat.S_IWUSRDoc/library/tarfile.rst:981: WARNING: py:const reference target not found: stat.S_IXGRP`|:const:`~stat.S_IXOTH 23

Involved adding docs for a number of constants, based on the comments from the source:

REGTYPE=b"0"# regular file
AREGTYPE=b"\0"# regular file
LNKTYPE=b"1"# link (inside tarfile)
SYMTYPE=b"2"# symbolic link
CHRTYPE=b"3"# character special device
BLKTYPE=b"4"# block special device
DIRTYPE=b"5"# directory
FIFOTYPE=b"6"# fifo special device
CONTTYPE=b"7"# contiguous file
GNUTYPE_LONGNAME=b"L"# GNU tar longname
GNUTYPE_LONGLINK=b"K"# GNU tar longlink
GNUTYPE_SPARSE=b"S"# GNU tar sparse file

The order matches that in the source.

GNUTYPE_SPARSE is referenced in the docs (and caused a warning), GNUTYPE_LONGNAME and GNUTYPE_LONGLINK are not; I added all three to docs.


📚 Documentation preview 📚: https://cpython-previews--113237.org.readthedocs.build/en/113237/library/tarfile.html

Copy link
Contributor

@willingcwillingc left a 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.


.. method:: TarInfo.replace(name=..., mtime=..., mode=..., linkname=...,
uid=..., gid=..., uname=..., gname=...,
.. method:: TarInfo.replace(name=..., mtime=..., mode=..., linkname=..., \
Copy link
Contributor

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?

Copy link
MemberAuthor

@hugovkhugovkDec 17, 2023

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:

image

https://docs.python.org/3/library/tarfile.html#tarfile.TarInfo.pax_headers

With them it's rendered properly, and the reference works properly:

image

https://cpython-previews--113237.org.readthedocs.build/en/113237/library/tarfile.html#tarfile.TarInfo.replace

Alternatively, we can remove the backticks, and make it a long, single line.

@hugovkhugovk merged commit f428c4d into python:mainDec 18, 2023
@hugovkhugovk deleted the docs-fix-sphinx-warnings-tarfile branch December 18, 2023 06:57
@miss-islington-app
Copy link

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @hugovk, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f428c4dafbfa2425ea056e7f2ed2ea45fa90be87 3.12 

@miss-islington-app
Copy link

Sorry, @hugovk, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f428c4dafbfa2425ea056e7f2ed2ea45fa90be87 3.11 

@bedevere-app
Copy link

GH-113244 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12 only security fixes label Dec 18, 2023
@bedevere-app
Copy link

GH-113245 is a backport of this pull request to the 3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11 only security fixes label Dec 18, 2023
hugovk added a commit to hugovk/cpython that referenced this pull request Dec 18, 2023
…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>
hugovk added a commit to hugovk/cpython that referenced this pull request Dec 18, 2023
…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>
ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull request Dec 26, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hugovk@willingc