091157fc7f
EC object metadata can currently have a mixture of bytestrings and unicode. The ssync_sender.send_put() method raises an UnicodeDecodeError when it attempts to concatenate the metadata values, if any bytestring has non-ascii characters. The root cause of this issue is that the object server uses unicode for the keys of some object metadata items that are received in the footer of an EC PUT request, whereas all other object metadata keys and values are persisted as bytestrings. This patch fixes the bug by changing diskfile write_metadata() function to encode all unicode metadata keys and values as utf8 encoded bytes before writing to disk. To cope with existing objects that have a mixture of unicode and bytestring metadata, the diskfile read_metadata() function is also changed so that all returned unicode metadata keys and values are utf8 encoded. This ensures that ssync_sender.send_put() (and any other caller of diskfile read_metadata) only reads bytestrings from object metadata. Closes-Bug: #1678018 Co-Authored-By: Alistair Coles <alistairncoles@gmail.com> Change-Id: Ic23c55754ee142f6f5388dcda592a3afc9845c39 |
||
---|---|---|
.. | ||
__init__.py | ||
brain.py | ||
common.py | ||
test_account_failures.py | ||
test_account_get_fake_responses_match.py | ||
test_account_reaper.py | ||
test_container_failures.py | ||
test_container_merge_policy_index.py | ||
test_container_sync.py | ||
test_empty_device_handoff.py | ||
test_object_async_update.py | ||
test_object_expirer.py | ||
test_object_failures.py | ||
test_object_handoff.py | ||
test_object_metadata_replication.py | ||
test_reconstructor_rebuild.py | ||
test_reconstructor_revert.py | ||
test_replication_servers_working.py | ||
test_signals.py |