indygreg / indygreg/python-zstandard
python-zstandard produces incomplete data after decompress
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 642
- Fork
- 116
- Merge medio
- 1g 14h
- PR unite (30g)
- 5
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia estraendo il file allegato text.txt.zstd ed eseguendo l’esempio Python zstandard fornito, quindi confrontalo con l’output da riga di comando di zstd 1.5.5. Traccia il motivo per cui zstd.decompress(data) si arresta a 1,048,576 byte nonostante il risultato valido di 8,724,469 byte restituito da zstd.exe; il lavoro è completato quando il binding Python restituisce i dati decompressi completi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100