db = motor.MotorClient('localhost', 27017, tz_aware=True)
class IdGridFSHandler(motor.web.GridFSHandler):
def get_gridfs_file(self, fs, path):
# Path is interpreted as _id instead of name.
# Return a Future MotorGridOut.
return fs.get(file_id=ObjectId(path))
Result in Browser (Chrome) error due to incompatibility between time zone aware dates:
# Check the If-Modified-Since, and don't send the result if the# content has not been modifiedims_value = self.request.headers.get("If-Modified-Since")if ims_value is not None:date_tuple = email.utils.parsedate(ims_value)if_since = datetime.datetime.fromtimestamp(time.mktime(date_tuple))if if_since >= modified:self.set_status(304)returnIs it a BUG?Do you have any suggestion on how to use tz_aware?Thanks,Maxi