Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

hugovk
Copy link
Member

@hugovkhugovk commentedDec 17, 2023
edited
Loading

Fix 23 warnings:

SPHINXERRORHANDLING=-n PATH=./venv/bin:$PATH sphinx-build -b html -d buildDoctrees -j auto -n. build/html library/tarfile.rst2>&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 andGNUTYPE_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.

@@ -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=..., \
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
edited
Loading

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.

willingc reacted with thumbs up emoji
@hugovkhugovk merged commitf428c4d intopython:mainDec 18, 2023
@hugovkhugovk deleted the docs-fix-sphinx-warnings-tarfile branchDecember 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 to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker f428c4dafbfa2425ea056e7f2ed2ea45fa90be87 3.12

@miss-islington-app
Copy link

Sorry,@hugovk, I could not cleanly backport this to3.11 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker f428c4dafbfa2425ea056e7f2ed2ea45fa90be87 3.11

@bedevere-app
Copy link

GH-113244 is a backport of this pull request to the3.12 branch.

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

GH-113245 is a backport of this pull request to the3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11only security fixes labelDec 18, 2023
hugovk added a commit to hugovk/cpython that referenced this pull requestDec 18, 2023
…ythonGH-113237)Fix Sphinx warnings in library/tarfile.rst(cherry picked from commitf428c4d)Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
hugovk added a commit to hugovk/cpython that referenced this pull requestDec 18, 2023
…ythonGH-113237)Fix Sphinx warnings in library/tarfile.rst(cherry picked from commitf428c4d)Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull requestDec 26, 2023
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@willingcwillingcwillingc approved these changes

@ethanfurmanethanfurmanAwaiting requested review from ethanfurmanethanfurman is a code owner

Assignees

@hugovkhugovk

Labels
docsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hugovk@willingc

[8]ページ先頭

©2009-2025 Movatter.jp