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

TypeError using GridFSHandler with tz_aware MotorClient

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 0.3.1
    • 0.1
    • None
    • None

    Description

      Reported on Google Groups:

      https://groups.google.com/d/msg/mongodb-user/Ructz1Z9UQQ/nK70YMojkQYJ

      GridFSHandler is a static file server that retrieves file contents from GridFS via a MotorClient.

      When the client sends the If-Modified-Since header, GridFSHandler parses it into a timezone-naive Python datetime and compares it to the file's upload_date from GridFS. If the latter is timezone-aware, because the MotorClient is timezone-aware, then datetime throws "TypeError: can't compare offset-naive and offset-aware datetimes".

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: