Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-290

[PATCH] GridOutIterator.__init__ assumes grid_out.length can always be converted to float

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.1
    • None
    • None

    Description

      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) /

      Attachments

        Activity

          People

            bernie@mongodb.com Bernie Hackett
            agx Guido Günther
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: