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

Conversation

rhit-parsonjc
Copy link

@rhit-parsonjcrhit-parsonjc commentedMay 17, 2024
edited by bedevere-appbot
Loading

@ghost
Copy link

ghost commentedMay 17, 2024
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@danifus
Copy link
Contributor

This looks good. A further enhancement would be to change the 2 ways directory ZipInfo instances are created into a single implementation. Perhaps a class method?

Currently there are two locations that I've been able to find where a directory ZipInfo is created and (as you discovered!) they don't create them in the same way. Here they are:

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

zinfo=cls(arcname,date_time)
zinfo.external_attr= (st.st_mode&0xFFFF)<<16# Unix attributes
ifisdir:
zinfo.file_size=0
zinfo.external_attr|=0x10# MS-DOS directory flag

A test or two to make sure this functionality is captured would be good too.

@thatch
Copy link
Contributor

@danifus are those requests a hard requirement for getting this in; the minimal changelooks good to me.

@danifus
Copy link
Contributor

I think a test is required but the refactoring isn't required for this PR

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@rhit-parsonjc@danifus@thatch

[8]ページ先頭

©2009-2025 Movatter.jp