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

TypeError using GridFSHandler with tz_aware MotorClient

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 0.1
    • Fix Version/s: 0.3.1
    • Component/s: None
    • Labels:
      None
    • # Replies:
      12
    • Last comment by Customer:
      true

      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

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                4 years, 4 weeks, 3 days ago
                Date of 1st Reply: