Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-11

MotorGridFS.put() example is wrong

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.2
    • Affects Version/s: 0.1
    • Component/s: None
    • None

      Florian Ludwig reports:

      The example here:
      http://motor.readthedocs.org/en/stable/api/gridfs.html?highlight=gridfs#motor.MotorGridFS.put

      is a little evil since if someone really does:

          f.write(data)
          f.close()
      

      you get corrupted files since the code does not wait for the write to finish.

      This actually misled a coworker of mine.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: