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

Excess spaces at the end of files or repositorys are not handle when extracting zip files on Windows. #94018

Closed
Labels
OS-windowstype-bugAn unexpected behavior, bug, or error
@Rygone

Description

@Rygone

Bug report

Excess spaces at the end of files or repositorys are not handle when extracting zip files on Windows.
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Documents \\test.txt'

Can be tested with thisDocuments.zip
and this piece of code:

from zipfile import ZipFilewith ZipFile('Documents.zip', 'r') as zip:    zip.extractall()

Fix proposal

cpython/Lib/zipfile.py : 1690

# remove end spacesdef remove_end_spaces(x):    for c in x[::-1]:        if(c == ' '): x = x[:-1]        else: return xarcname = (remove_end_spaces(x) for x in arcname)

Your environment

  • CPython versions tested on: python 3.9
  • Operating system and architecture: Windows 10 Professionnel 21H2 19044.1706

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp