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

Regression in zipfile, read1(-1) after seek() returns empty byte string #102956

Closed
Assignees
gpshead
Labels
3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@hrnciar

Description

@hrnciar

Bug report

When debugging a test failure inhttps://pypi.org/project/fs/ I found a regression inzipfile, read1(-1) after seek() returns empty byte string instead of substring. I've bisected it into this commit330f1d5.

Reproducer:

import zipfile# First, create the zip:#   echo 'Hello, World' > hello.txt#   zip hello.zip hello.txtwith zipfile.ZipFile('hello.zip') as myzip:    with myzip.open('hello.txt') as myfile:        print(myfile.read(5))        print(myfile.seek(2, 1))        print(myfile.read1(-1))

Expected output (3.11.2):

❯ python3.11 reproduce.pyb'Hello'7b'World\n'

Actual output (3.12.0a6):

❯ python3.12 reproduce.pyb'Hello'7b''

Your environment

  • CPython versions tested on: main
  • Operating system and architecture: Fedora 37, x86_64

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp