-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_dump_date year conversion doesn't zfill(4) #1739
Comments
I'm not clear why dates prior to 1000 are relevant in an HTTP context. Can you explain why you need Werkzeug's |
_dump_date is used as the default datetime and date encoding function in Flask's JSONEncoder class: https://github.com/pallets/flask/blob/master/src/flask/json/__init__.py |
Since you have specialized data, you should probably be using a better representation than HTTP dates anyway. I'd recommend overriding |
I did override it. I figured I'd mention it in case you wanted to apply the included patch - it mitigates this python issue https://bugs.python.org/issue13305 in this case. Since the function is being used for common date encoding in Flask maybe they should rethink the http_date use in their default encoder... Thanks for the response. |
I have some dates that have a year before year 1000 and the _dump_date function doesn't represent them as zero filled to 4 so parsing the output with '%a, %d %b %Y %H:%M:%S %Z' throws an exception.
The text was updated successfully, but these errors were encountered: