Object metadata keys are lowercased when uploading to GCS
- Langage dominant
- Python
- Étoiles
- 2.1k
- Forks
- 931
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 4
Description
## 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).
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez au point d’entrée upload_object_via_stream et suivez la manière dont le dictionnaire de métadonnées supplémentaire est préparé pour Google Cloud Storage. Reproduisez l’exemple avec la clé camelCase, puis vérifiez que les métadonnées de l’objet téléversé conservent leur casse d’origine.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- google-cloud, python
- Domaine
- cloud
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100