-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Please see attached patch. I encountered empty files in a DB which hat git_out.lenght = None and therefore:
Traceback (most recent call last):
File "backup-images.py", line 147, in <module>
sys.exit(main(sys.argv))
File "backup-images.py", line 144, in main
backup_all(db, outdir, collection)
File "backup-images.py", line 90, in backup_all
backup_file(outname, dbobj)
File "backup-images.py", line 38, in backup_file
for data in dbobj:
File "/usr/lib/python2.6/dist-packages/gridfs/grid_file.py", line 464, in _iter_
return GridOutIterator(self, self.__chunks)
File "/usr/lib/python2.6/dist-packages/gridfs/grid_file.py", line 489, in _init_
self.__max_chunk = math.ceil(float(grid_out.length) /