Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Feature request: allow `decompress` to decompress stream data without content size in the header

オープン
#150 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

zstd.decompress、max_output_size、ZstdDecompressor.stream_reader を使って例を再現し、現在の動作を比較します。decompress API のエントリーポイントとそのテストから始めます。既知の出力サイズを要求せずにコンテンツサイズのないフレームを伸長でき、報告されたケースのカバレッジがあれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Edit: this is documented, but I think it would be an useful addition. Maybe by passing max_output_size=-1?

The example below raises ZstdError: could not determine content size in frame header

import io
import zstandard as zstd
data = b'some data'
input_buffer = io.BytesIO(data)
with zstd.ZstdCompressor().stream_reader(input_buffer) as r:
    compressed = r.read()
decompressed = zstd.decompress(compressed)
assert decompressed == data

Passing max_output_size to the decompress call works as expected:

...
decompressed = zstd.decompress(compressed, max_output_size=len(data))
assert decompressed == data

Using ZstdDecompressor.stream_reader also works:

...
with zstd.ZstdDecompressor().stream_reader(io.BytesIO(compressed)) as r:
    decompressed = r.read()
assert decompressed == data

I think decompress should handle this case as well, since it's not always possible to known how the data was compressed.

The package version I use is zstandard 0.15.2 on windows 10 (but I don't think it's os dependent)

主要言語
C
スター
641
フォーク
117
平均マージ
1日 14時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

indygreg/python-zstandard のほかの issue

indygreg/python-zstandard の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。