gh-150075: tar.addfile() doesn't set member offsets#150131
gh-150075: tar.addfile() doesn't set member offsets#150131grantlouisherman wants to merge 3 commits into
Conversation
…file Signed-off-by: Grant Herman <grantlouisherman041@gmail.com>
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
I dont think the news is necessary it seems like a pretty minor addition |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
@ethanfurman should I squash commits? |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Original bug report:
Bug report
Bug description:
It appears that
tarfile.TarFile.addfile()sets neitheroffsetnoroffset_dataattributes in theTarInfoadded toself.members, when it's done adding the file. Members in a reopened TAR have correct values.Reproducer
Expected output
Actual output
CPython versions tested on:
3.15
Operating systems tested on:
Linux
Fix
I added the offset info for a given file based on the current offset of the file and then after the block size is calculated. I also included a test to validate the behavior