PYTHON-621: Fixed GridOut.read(0) returning string in Python 3
This commit is contained in:
parent
4142442c73
commit
464941e5ad
@ -467,7 +467,7 @@ class GridOut(object):
|
||||
self._ensure_file()
|
||||
|
||||
if size == 0:
|
||||
return ""
|
||||
return EMPTY
|
||||
|
||||
remainder = int(self.length) - self.__position
|
||||
if size < 0 or size > remainder:
|
||||
|
||||
@ -73,6 +73,9 @@ class TestGridFile(unittest.TestCase):
|
||||
g = GridOut(self.db.fs, f._id)
|
||||
self.assertEqual(b(""), g.read())
|
||||
|
||||
# test that reading 0 returns proper type
|
||||
self.assertEqual(b(""), g.read(0))
|
||||
|
||||
def test_md5(self):
|
||||
f = GridIn(self.db.fs)
|
||||
f.write(b("hello world\n"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user