Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

python-zstandard produces incomplete data after decompress

未关闭
#196 19 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 10 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

首先提取附加的 text.txt.zstd 文件并运行提供的 Python zstandard 示例,然后将其与 zstd 1.5.5 的命令行输出进行比较。追踪 zstd.decompress(data) 为何在 1,048,576 字节处停止,尽管 zstd.exe 返回了有效的 8,724,469 字节结果;完成标准是 Python binding 返回完整的解压数据。

由索引模型根据 Issue 内容生成。

描述

bug

I originally filed this against urllib3 in https://github.com/urllib3/urllib3/issues/3008 but the investigation so far is showing that urllib3 is providing the correct data to python-zstandard.

Environment info

OS Windows-10-10.0.22621-SP0
Python 3.10.11
urllib3 2.0.1

pip freeze results:

appdirs==1.4.4
certifi==2022.9.24
charset-normalizer==2.1.1
colorama==0.4.6
flake8==5.0.4
idna==3.4
mccabe==0.7.0
numpy==1.23.4
pycodestyle==2.9.1
pydiffx==1.1
pyflakes==2.5.0
python-gitlab==3.12.0
RBTools==4.0
requests==2.28.1
requests-toolbelt==0.10.1
six==1.16.0
texttable==1.6.7
tqdm==4.64.1
typing_extensions==4.4.0
urllib3==2.0.1
zstandard==0.21.0

Sample code

Example source data to decompress

I have attached a zip of text.txt.zstd because GitHub doesn't support attaching .zstd files. This file text.txt.zstd contains the raw data passed to ZstdDecoder.decompress(). Extract that text.txt.zstd file out of the zip then run:

import zstandard as zstd

print('Using zstandard backend: %s' % zstd.backend)

with open(r'C:\utils\temp\text.txt.zstd', 'rb') as f:
    data = f.read()

print('decompressed %d into %d bytes' %
      (len(data), len(zstd.decompress(data))))

My output is:

Using zstandard backend: cext
decompressed 2554 into 1048576 bytes

Whereas downloading zstd 1.5.5 and running zstd.exe text.txt.zstd -d -o hi.txt produces 8724469 bytes and a valid text file.

主要语言
C
星标
642
派生
118
平均合并
9 天 3 小时
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

indygreg/python-zstandard 的其他 Issue

查看 indygreg/python-zstandard 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。