Small patches to make backup work and work-around bug #11066

This commit is contained in:
alexhudson
2008-02-16 13:30:17 +00:00
parent 651fc3c33b
commit a2da45bb5c
3 changed files with 7 additions and 2 deletions
@@ -118,7 +118,7 @@ class StoreBackupCommand(Command):
props = docstore.PropGet(document.uid)
for key in props.keys():
headerx.SetKey("BONGO.%s" % key, props[key])
backup_file.write(headerx.ToString())
backup_file.write(headerx.ToString().encode("utf-8"))
# tar files have a 512 byte header (tar_info.tobuf()), and then the content
# content is padded to a multiple of 512 bytes
+4 -1
View File
@@ -43,7 +43,10 @@ class Collection:
ret = re.split(r"(?<!\\) ", response.message)
ret = [re.sub(r"\\ ", " ", x) for x in ret]
self.uid, self.type, self.flags, self.name = ret
if len(ret) < 4:
return null
self.uid, self.type, self.flags = ret[0:3]
self.name = " ".join(ret[3:])
self.flags = int(self.flags)
self.type = int(self.type)
@@ -596,6 +596,7 @@ class StoreClient:
raise CommandError(r)
def List(self, path, props=[], start=-1, end=-1, flags=None, mask=None):
path = path.replace(" ", "\ ")
command = "LIST %s" % path
if start == -1 and end == -1:
@@ -719,6 +720,7 @@ class StoreClient:
self.connection.Close()
def Read(self, doc):
doc = doc.replace(" ", "\ ")
self.stream.Write("READ %s" % (doc))
r = self.stream.GetResponse()
if r.code != 2001: