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 <wangxiyuan1007@gmail.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>
Related-bug: #1805332
Change-Id: Ia7653f9fcbe902abc203c10c80ab44a641a4d8f9
(cherry picked from commit 1d25a2b7a2)