Skip to content
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

Correctly JSON-encode datetimes aware of non-UTC timezones #2374

Merged
merged 8 commits into from
Jun 15, 2017

Commits on Jun 14, 2017

  1. Add UTs for pallets#2372

    test_encode_aware_datetime() fails for non-UTC timezones due to the bug.
    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    d75d83d View commit details
    Browse the repository at this point in the history
  2. Correctly encode aware, non-UTC datetime objects

    http_date() requires timetuple in UTC, but JSONEncoder.default() was
    passing a local timetuple instead.
    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    d41e2e6 View commit details
    Browse the repository at this point in the history
  3. Rewrite test_jsonify_aware_datetimes without pytz

    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    0e6cab3 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'master' of github.com:pallets/flask into json_encode_no…

    …n_utc_datetimes
    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    5b38fe2 View commit details
    Browse the repository at this point in the history
  5. Use pytz again for tests

    This is because datetime.timezone is Python 3 only.  The only
    alternative would be to hand-spin a datetime.tzinfo subclass, an
    overkill.
    
    This reverts commit 0e6cab3.
    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    eb96183 View commit details
    Browse the repository at this point in the history
  6. Skip aware datetime tests if pytz is unavailable

    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    3405063 View commit details
    Browse the repository at this point in the history
  7. Re-revert to not using pytz

    Will spin a tzinfo subclass.
    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    f803760 View commit details
    Browse the repository at this point in the history
  8. Actually hand-spin and use a tzinfo subclass

    This is for Python 2.x compatibility.
    
    Suggested-by: David Lord <davidism@gmail.com>
    Eugene M. Kim committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    63ccdad View commit details
    Browse the repository at this point in the history