MotorGridFS.put() example is wrong

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 0.2
    • Affects Version/s: 0.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • 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:
              A. Jesse Jiryu Davis
              Reporter:
              A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: