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/644839 /git.openstack. org/cgit/ openstack/ glance_ store/commit/ ?id=9c8364bacfb e831a755b096a92 fb7da2ff3c878d
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit 9c8364bacfbe831 a755b096a92fb7d a2ff3c878d
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 66f9fee378b3d08 02d392a85f)
Change-Id: Ia7653f9fcbe902
(cherry picked from commit 1d25a2b7a21e957