Object metadata keys are lowercased when uploading to GCS
- 主要言語
- Python
- スター
- 2.1k
- フォーク
- 931
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 4
説明
## 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).
コントリビューションガイド
調査の方向性
エントリーポイント upload_object_via_stream から開始し、Google Cloud Storage 用の追加メタデータ dict がどのように準備されるかを追跡します。camelCase のキーを使った例を再現し、その後、アップロードされたオブジェクトのメタデータが元の大文字と小文字の使い分けを保持していることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- google-cloud, python
- 領域
- cloud
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100