Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-119052: Set CRC to 0 in mkdir in all cases#119108

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rhit-parsonjc wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromrhit-parsonjc:crcfix
Open
Changes from1 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
NextNext commit
Set CRC to 0 in mkdir when argument is an instance of ZipInfo
  • Loading branch information
Joseph C. Parsons committedMay 16, 2024
commit6ab436ef79f65159c651a0189c07e8377e93c1df
3 changes: 2 additions & 1 deletionLib/zipfile/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1947,13 +1947,14 @@ def mkdir(self, zinfo_or_directory_name, mode=511):
directory_name += "/"
zinfo = ZipInfo(directory_name)
zinfo.compress_size = 0
zinfo.CRC = 0
zinfo.external_attr = ((0o40000 | mode) & 0xFFFF) << 16
zinfo.file_size = 0
zinfo.external_attr |= 0x10
else:
raise TypeError("Expected type str or ZipInfo")

zinfo.CRC = 0

with self._lock:
if self._seekable:
self.fp.seek(self.start_dir)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp