X Tutup
The Wayback Machine - https://web.archive.org/web/20221223141448/https://github.com/python/cpython/pull/22116
Skip to content
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

bpo-41728: Debug logging when adding TarInfo object #22116

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

llamafilm
Copy link

@llamafilm llamafilm commented Sep 5, 2020

bpo-41728: Debug logging when adding TarInfo

Log attributes of the TarInfo object including name, size mtime, mode, uname, and gname when using addfile()
Only when debug=3. This level appears to be unused although it is already documented.
The add() method already logs the name, but this logs the arcname instead so it's not redundant.

https://bugs.python.org/issue41728

Use debug level 3 which is currently unused although it is documented.
@llamafilm llamafilm requested a review from ethanfurman as a code owner Sep 5, 2020
@the-knights-who-say-ni
Copy link

the-knights-who-say-ni commented Sep 5, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@llamafilm

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@llamafilm llamafilm changed the title Debug logging when adding TarInfo object bpo-41728: Debug logging when adding TarInfo object Sep 6, 2020
Lib/tarfile.py Outdated
@@ -2009,6 +2009,8 @@ def addfile(self, tarinfo, fileobj=None):
blocks += 1
self.offset += blocks * BLOCKSIZE

self._dbg(3, "%s, size: %i, mtime: %.0f, mode: %i, uname: %s, gname: %s" % (tarinfo.name, tarinfo.size, tarinfo.mtime, tarinfo.mode, tarinfo.uname, tarinfo.gname))
Copy link
Contributor

@ZackerySpytz ZackerySpytz Oct 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use an f-string and wrap lines at 79 characters.

Copy link
Author

@llamafilm llamafilm Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other log message in this code uses % interpolation so I just tried to match the style.

@ZackerySpytz
Copy link
Contributor

ZackerySpytz commented Oct 18, 2020

Unfortunately, this PR might not be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants
X Tutup