diff options
authorPrashanth Pai <>2015-06-23 19:45:15 +0530
committerPrashanth Pai <>2015-06-23 19:45:15 +0530
commitd7e7b73006b8ca2b526111b54a5af0ee6290697a (patch)
parent2c468ae0d5a1e25998373abb72d87b1ee7693816 (diff)
Fix parsing of binary data as str
This change will return the raw string read as is which fixes case where arbitrary binary data (such as an array.array) is written and read back as string to be unmarshalled back as array.array This patch does not yet address writing array.array and arbitrary objects into binary files. That will be sent as a separate change. Change-Id: Ic135198cca2c0dc8e103176920056e9df0c00f2b Signed-off-by: Prashanth Pai <>
1 files changed, 1 insertions, 1 deletions
diff --git a/gluster/ b/gluster/
index bd6f240..5bbb8cb 100755
--- a/gluster/
+++ b/gluster/
@@ -322,7 +322,7 @@ class File(object):
# In python 2.x, read() always returns a string. It's really upto
# the consumer to decode this string into whatever encoding it was
# written with.
- return rbuf.value[:ret]
+ return rbuf.raw[:ret]
elif ret < 0:
err = ctypes.get_errno()
raise OSError(err, os.strerror(err))