Object metadata keys are lowercased when uploading to GCS
- Lingua principale
- Python
- Stelle
- 2.1k
- Fork
- 931
- Merge medio
- 1g 2h
- PR unite (30g)
- 4
Descrizione
## Summary
Mixed-case metadata is lowercased when using libcloud to upload objects to Google Cloud Storage.
## Detailed Information
I'm using libcloud to upload files to a Google Cloud Storage bucket together with object metadata.
In the process, the keys in my metadata dict are being lowercased. This is not due to Google Cloud Storage, which does support mixed case metadata.
The issue can be reproduced following the example from the docs:
```
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
cls = get_driver(Provider.GOOGLE_STORAGE)
driver = cls('SA-EMAIL', './SA.json') # provide service account credentials here
FILE_PATH = '/home/user/file'
extra = {'meta_data': {'camelCase': 'foo'}}
# Upload with metadata
with open(FILE_PATH, 'rb') as iterator:
obj = driver.upload_object_via_stream(iterator=iterator,
container=container,
object_name='file',
extra=extra)
```
The file uploads succesfully, but resulting metadata will look as follows:

Where `camelCase` has been turned into `camelcase`.
I'm using apache-libcloud==3.0.0 with Python 3.8 on Linux (the python:3.8 Docker image).
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal punto di ingresso upload_object_via_stream e segui come viene preparato il dizionario di metadati aggiuntivo per Google Cloud Storage. Riproduci l’esempio con la chiave camelCase, quindi verifica che i metadati dell’oggetto caricato mantengano la loro capitalizzazione originale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- google-cloud, python
- Ambito
- cloud
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100