-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-41728: Debug logging when adding TarInfo object #22116
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
base: main
Are you sure you want to change the base?
Conversation
Use debug level 3 which is currently unused although it is documented.
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 MissingOur records indicate the following people have not signed the CLA: 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 You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
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)) |
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.
Please use an f-string and wrap lines at 79 characters.
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.
Every other log message in this code uses % interpolation so I just tried to match the style.
Misc/NEWS.d/next/Library/2020-09-06-00-22-17.bpo-41728.Lx8Z_N.rst
Outdated
Show resolved
Hide resolved
Unfortunately, this PR might not be accepted. |
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
The following commit authors need to sign the Contributor License Agreement: |
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