Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Allow chunked uploads (and maybe even streaming uploads)

Aperta
#459 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Inizia in dropbox_client.py intorno alle righe 533-539, dove i corpi delle richieste sono limitati a bytes, e confronta questo comportamento con la documentazione collegata di Requests sullo streaming e sui caricamenti a blocchi. Determina come l'SDK dovrebbe accettare oggetti simili a file o generatori, documentando anche il comportamento dei tentativi e del riavvolgimento; il lavoro è completato quando le forme di caricamento scelte sono supportate senza l'attuale restrizione ai soli bytes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Why is this feature valuable to you? Does it solve a problem you're having?
The requests library allows both streaming and chunked uploads (see https://requests.readthedocs.io/en/latest/user/advanced/#streaming-uploads and https://requests.readthedocs.io/en/latest/user/advanced/#chunk-encoded-requests). This has two benefits:

  1. It is sufficient to only load small parts of a file into memory before upload.
  2. It is possible to limit bandwidth usage by using a generator that provides chunks at a limited rate.

The Dropbox API of course already requires upload sessions (files/upload_session_start, files/upload_session_append and files/upload_session_finish) to upload files > 150 MB. However, this approach by itself does not replace chunked or streaming uploads because:

  1. The request body should be ideally >= 4 MB to reduce the total number of API calls (both for efficiency and to not exhaust data transport API call limits).
  2. Bandwidth control will be very coarse when performed on chunks of 4 MB compared for example 2 kB.
  3. Memory usage will still be larger compared to 1 kB or 2 kB chunks, especially for parallel uploads.

Describe the solution you'd like
Requests supports streaming uploads by passing a file-like object as the request body and chunked uploads by passing a generator as the request body. However, the Python SDK explicitly prevents both by requiring the request body to be of type bytes:

https://github.com/dropbox/dropbox-sdk-python/blob/9895d705317583cedb9fc11e5aa1f17f6bea303a/dropbox/dropbox_client.py#L533-L539

It would be good to either completely drop this limitation, with appropriate warnings in the doc string, or at least allow chunked uploads (where requests handles retry / rewind logic) even when disallowing streaming uploads.

Describe alternatives you've considered
Not at present.

Lingua principale
Python
Stelle
983
Fork
331
Merge medio
3m
PR unite (30g)
10

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dropbox/dropbox-sdk-python

Tutte le issue di dropbox/dropbox-sdk-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.