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
Show file tree
Hide file tree
Changes fromall commits
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
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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
Fixed mkdir method of zipfile.ZipFile when ZipInfo object passed in with no CRC
attribute
Loading

[8]ページ先頭

©2009-2025 Movatter.jp