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-145607: Ensure BIG_DATA has two compressed blocks in test_bz2#145730

Merged
hugovk merged 1 commit intopython:mainfrom
emmatyping:fix-bz2-flake
Mar 10, 2026
Merged

gh-145607: Ensure BIG_DATA has two compressed blocks in test_bz2#145730
hugovk merged 1 commit intopython:mainfrom
emmatyping:fix-bz2-flake

Conversation

@emmatyping
Copy link
Member

@emmatypingemmatyping commentedMar 10, 2026
edited
Loading

TheBIG_DATA variable intest_bz2 will sometimes only have one block of compressed data instead of the two it is intended to contain due to the value depending on the order of listing files. To fix this, we stream in input data and check for multiple block header magic strings to ensure that there are at least 2 block headers.

This is an unfortunate hack, but the bz2 module doesn't expose flushing in calls toBZ2Compressor.compress() so we cannot directly generate two blocks. I'm also not certain if block headers can span the output to.compress(), so conservatively I have the code scan the entire set of data, which should only need to happen a few times at test setup time. There's probably a few ways to optimize this code, but I wanted to keep it simple to get it in before the alpha tomorrow. I specifically did not want to use BZ2File as I wanted the module setup code to be as minimal as possible in case the implementation is broken.

@emmatyping
Copy link
MemberAuthor

Oh also I ran the test in a loop with random file orderings for a number of minutes to ensure that this actually fixes the bug.

@emmatyping
Copy link
MemberAuthor

!buildbot s390x RHEL9

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@emmatyping for commitf9e9d59 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145730%2Fmerge

The command will test the builders whose names match following regular expression:s390x RHEL9

The builders matched are:

  • s390x RHEL9 LTO PR
  • s390x RHEL9 PR
  • s390x RHEL9 Refleaks PR
  • s390x RHEL9 LTO + PGO PR

@hugovkhugovk merged commit19676e5 intopython:mainMar 10, 2026
59 checks passed
@miss-islington-app
Copy link

Thanks@emmatyping for the PR, and@hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@hugovk
Copy link
Member

Thank you!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMar 10, 2026
pythonGH-145730)(cherry picked from commit 19676e5fc28bdee8325a062a31ddeee60960cf75)Co-authored-by: Emma Smith <emma@emmatyping.dev>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMar 10, 2026
pythonGH-145730)(cherry picked from commit 19676e5fc28bdee8325a062a31ddeee60960cf75)Co-authored-by: Emma Smith <emma@emmatyping.dev>
@bedevere-app
Copy link

GH-145733 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMar 10, 2026
@bedevere-app
Copy link

GH-145734 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMar 10, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@emmatyping@bedevere-bot@hugovk

[8]ページ先頭

©2009-2026 Movatter.jp