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 |
||
---|---|---|
.. | ||
account | ||
cli | ||
common | ||
container | ||
locale | ||
obj | ||
proxy | ||
__init__.py |