Where is the blobfile supposed to be copied?
Should it be copied during the pickling/unpickling of the blob object, by sort some of hook ?
Actually, the pickling/unpickling is initiated in zope.location.pickling.locationCopy,
and I've tried an small hack that writes the new blobfile at the end of this function.
By replacing:
return unpickler.load()
with:
copied = unpickler.load()
if hasattr(copied, '_data') and type(copied._data) is Blob: copied._data._create_uncommitted_file()
targetfile = open(copied._data._current_filename(), 'w')
sourcefile = loc.openDetached()
chunk = sourcefile.read(1000000)
while chunk: targetfile.write(chunk)
chunk = sourcefile.read(1000000) targetfile.close()
return copied
It also need the fix mentionned in my previous comment (blob.py).
Where is the blobfile supposed to be copied?
Should it be copied during the pickling/unpickling of the blob object, by sort some of hook ?
Actually, the pickling/unpickling is initiated in zope.location. pickling. locationCopy,
and I've tried an small hack that writes the new blobfile at the end of this function.
By replacing:
return unpickler.load()
with:
copied = unpickler.load()
copied. _data._ create_ uncommitted_ file() _data._ current_ filename( ), 'w') read(1000000)
targetfile .write( chunk) read(1000000)
targetfile. close()
if hasattr(copied, '_data') and type(copied._data) is Blob:
targetfile = open(copied.
sourcefile = loc.openDetached()
chunk = sourcefile.
while chunk:
chunk = sourcefile.
return copied
It also need the fix mentionned in my previous comment (blob.py).