-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
gh-107845: Fix symlink handling for tarfile.data_filter #107846
Conversation
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.
I've found only one comment which might be improved.
As I'm thinking about more possible tests, I can imagine two more types:
- Chains of symlinks/hardlinks, something like
symlink → hardlink → file
orhardlink → symlink → file
etc. - (This can be combined with idea 1) Tests of archives where the symlinks/hardlinks are added before their destinations. So for the first example above, it'd be add symlink pointing to nonexisting hardlink, add hardlink to nonexisting file, and then add the target file.
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.
LGTM.
The doc and tarfile file LGTM. I didn't have time to review carefully the tests. Maybe first merge into main, see how it goes on buildbots, and only later backport to all branches. Sometimes, we have bad surprises.
Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
AFAIK you can't extract a hardlink to file that's later in the archive (unless the file already exists on disk). Tarfile only searches entries before the link. |
Co-authored-by: Victor Stinner <vstinner@python.org>
Can't seem to get the buildbots to run, so I'll watch them after merging. |
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @encukou, I could not cleanly backport this to |
Sorry, @encukou, I could not cleanly backport this to |
…GH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
GH-108209 is a backport of this pull request to the 3.11 branch. |
GH-108210 is a backport of this pull request to the 3.10 branch. |
…GH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…GH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
GH-108211 is a backport of this pull request to the 3.12 branch. |
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
GH-108274 is a backport of this pull request to the 3.9 branch. |
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
GH-108279 is a backport of this pull request to the 3.8 branch. |
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…ythonGH-107846) (python#108274) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
📚 Documentation preview 📚: https://cpython-previews--107846.org.readthedocs.build/