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-98286: handle empty filename in ZipFile/ZipInfo properly#98346

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

Merged
gpshead merged 1 commit intopython:mainfromobfusk:zipfile-empty-filename
Oct 29, 2022

Conversation

@obfusk
Copy link
Contributor

@obfuskobfusk commentedOct 17, 2022
edited by bedevere-bot
Loading

@obfusk
Copy link
ContributorAuthor

obfusk commentedOct 17, 2022
edited
Loading

NB: this also raises theValueError for file names consisting entirely of slashes (which are considered directories, even if they actually contain data), which seems correct to me, but (unlike getting rid of theIndexErrors) could potentially break some existing code (though all tests are green).

>>>importzipfile>>>fh=zipfile.ZipFile("x.zip")>>>fh.infolist()[<ZipInfofilename='///'filemode='drwxrwxr-x'external_attr=0x10>]>>>fh.extract("///","some_dir")ValueError:Emptyfilename.

@obfusk
Copy link
ContributorAuthor

Note thatunzip fails to extract file names consisting entirely of slashes as well though:

$ unzip x.zipArchive:  x.zipwarning:  stripped absolute path spec from ///mapname:  conversion of  failed

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@obfusk@gpshead@bedevere-bot@nanjekyejoannah

[8]ページ先頭

©2009-2025 Movatter.jp