8000 gh-108948: tarfile should handle sticky bit in FreeBSD by sorcio · Pull Request #108950 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108948: tarfile should handle sticky bit in FreeBSD #108950

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

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make TarFile.chmod slightly more readable
  • Loading branch information
sorcio committed Sep 16, 2023
commit 23a6fd57c5bcf9126b92d1a37093f52d1198763c
7 changes: 5 additions & 2 deletions Lib/tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2586,10 +2586,13 @@ def chmod(self, tarinfo, targetpath):
# of the ExtractError, but we keep the original error
# around for good information.
raise exc2 from exc1
else:
# The second chmod() without sticky bit succeeded
pass
else:
raise
except OSError as e:
raise ExtractError("could not change mode") from e
except OSError as exc3:
raise ExtractError("could not change mode") from exc3

def utime(self, tarinfo, targetpath):
"""Set modification time of targetpath according to tarinfo.
Expand Down
0