[Feature request or doc oversight?] Apparently, there's still no way to read uncompressed content as file-like object #465
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 28/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- api, documentation
Direzione di ricerca
Leggi prima la sezione "Raw Response Content" del Quickstart e ispeziona le interfacce esistenti .raw, iter_content() e .content. Chiarisci la semantica di lettura sicura, simile a quella di un file, per i dati della risposta non compressi, incluse quantità di lettura arbitrarie, quindi documenta il comportamento supportato nel Quickstart; il lavoro è completato quando l’API e il suo utilizzo sono specificati chiaramente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This was originally discussed here: https://github.com/psf/requests/issues/465 For some reason the ticket was however closed without a file-like object approach being added here: https://requests.readthedocs.io/en/latest/user/quickstart/ (Other than the somewhat odd .raw that returns something I suspect most people that just want a file-like stream aren't interested in.) There doesn't seem to be an explanation why that ticket was closed, and the discussion suggesting something was fixed but I can't really figure out what.
Since it's not that easy to wrap iter_content() to a file like object with arbitrary read amounts and just wrapping .content for that generically seems to be unsafe to me due to denial of service, it would be nice if this was provided and then documented here: https://requests.readthedocs.io/en/latest/user/quickstart/ (With a section alike to "Raw Response Content".)
The requests version I tested on is: 2.27.1
- Lingua principale
- Python
- Stelle
- 54.7k
- Fork
- 10.8k
- Merge medio
- 18m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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.
Altre issue di psf/requests
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
`iter_lines(decode_unicode=True, delimiter=<str>)` raises `TypeError` when `Response.encoding` is `None`Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
get_encoding_from_headers treats any content type containing 'text' as text/* (ISO-8859-1)Forse già presa @suyashgitt l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Invalid `params` type (e.g. int) raises misleading "TypeError: Cannot mix str and non-str arguments"Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Tutte le issue di psf/requests
Issue simili
-
documentation type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
add entry to blockAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Forse già presa @0z5a l’ha presa oggi. Apertaneeds-triage
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2xForse già presa @Shizoqua l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/TokenEconomizer#221 ·
I maintainer di solito rispondono entro 1 giorno
-
plot_graph crashes when a mesh node has no m2m edgeForse già presa @tygvi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mllam/neural-lam#883 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni