During large file uploads under py3, we are occasionally seeing a
"unicode objects must be encoded before hashing" error even though
we are reading from a byte stream. From what I can tell, it looks
like it's happening when a zero-byte read is requested, so we handle
that case explicitly. This is a band-aid fix; we still need to track
down the source.
Reviewed: https:/ /review. openstack. org/620234 /git.openstack. org/cgit/ openstack/ glance_ store/commit/ ?id=1d25a2b7a21 e95766f9fee378b 3d0802d392a85f
Committed: https:/
Submitter: Zuul
Branch: master
commit 1d25a2b7a21e957 66f9fee378b3d08 02d392a85f
Author: wangxiyuan <email address hidden>
Date: Tue Nov 27 14:50:50 2018 +0800
Prevent unicode object error from zero-byte read
During large file uploads under py3, we are occasionally seeing a
"unicode objects must be encoded before hashing" error even though
we are reading from a byte stream. From what I can tell, it looks
like it's happening when a zero-byte read is requested, so we handle
that case explicitly. This is a band-aid fix; we still need to track
down the source.
Co-authored-by: wangxiyuan <email address hidden>
Co-authored-by: Brian Rosmaita <email address hidden>
Related-bug: #1805332 abc203c10c80ab4 4a641a4d8f9
Change-Id: Ia7653f9fcbe902