1. 04 8月, 2023 1 次提交
  2. 22 6月, 2023 1 次提交
    • B
      *: Adapt to deprecation of datetime utc methods · 4d4d80c1
      Ben Darnell 提交于
      Python 3.12 deprecates the utcnow and utcfromtimestamp methods and
      discourages the use of naive datetimes to represent UTC. This was
      previously the main way that Tornado used datetimes (since it was
      the only option available in Python 2 before the introduction
      of datetime.timezone.utc in Python 3.2).
      
      - httpclient_test: Test-only change to test that both kinds of datetimes
        are supported in If-Modified-Since (this just calls
        httputil.format_timestamp)
      - httputil: No functional changes, but format_timestamp's
        support for both naive and aware datetimes is now tested.
      - locale: format_timestamp now supports aware datetimes (in
        addition to the existing support for naive datetimes).
      - web: Cookie expirations internally use aware datetimes.
        StaticFileHandler.get_modified_time now supports both and the
        standard implementation returns aware.
      
      It feels fragile that "naive" and "aware" datetimes are not distinct
      types but subject to data-dependent behavior. This change uses
      "aware" datetimes throughout Tornado, but some operations (comparisons
      and subtraction) fail with mixed datetime types and if I missed any
      in this change may cause errors if naive datetimes were used (where
      previously naive datetimes would have been required). But that's
      apparently the API we have to work with.
      4d4d80c1
  3. 14 5月, 2023 1 次提交
    • B
      web: Fix an open redirect in StaticFileHandler · 8f35b31a
      Ben Darnell 提交于
      Under some configurations the default_filename redirect could be exploited
      to redirect to an attacker-controlled site. This change refuses to redirect
      to URLs that could be misinterpreted.
      
      A test case for the specific vulnerable configuration will follow after the
      patch has been available.
      8f35b31a
  4. 22 4月, 2023 1 次提交
  5. 09 4月, 2023 1 次提交
    • B
      typing: Eagerly import all submodules in __init__.pyi · 7c842b47
      Ben Darnell 提交于
      This makes the auto-import functionality compatible with mypy
      and other typing-based tools such as autocomplete functionality.
      Excluding these imports from static typing feels like a premature
      optimization and made it much less appealing to make use of the
      auto-imports.
      
      This may slow down type checking of applications that use Tornado by
      a little, since the type checker must now process all of Tornado and
      not only the subset that was imported. However, the increasing use
      of long-lived daemons for type checkers should mitigate this cost.
      7c842b47
  6. 31 3月, 2023 1 次提交
  7. 22 2月, 2023 1 次提交
  8. 29 1月, 2023 2 次提交
    • B
      web: Accept all kwargs in clear_cookie · 91a54ddd
      Ben Darnell 提交于
      In some cases it is now required to pass matching values for
      samesite and secure as when the cookie was set.
      
      clear_all_cookies is now deprecated because the name of a cookie
      is no longer reliably sufficient to clear it.
      
      Fixes #2911
      91a54ddd
    • B
      web: List all set_cookie arguments instead of kwargs · 06043625
      Ben Darnell 提交于
      Multiple arguments needed special cases anyway, so it's better to
      just be explicit about what's supported.
      
      set_signed_cookie still uses kwarg forwarding since we don't need
      to worry about the special cases at this level and using
      explicit arguments would involve duplicating defaults in multiple
      places.
      06043625
  9. 24 1月, 2023 1 次提交
  10. 28 11月, 2022 2 次提交
  11. 04 6月, 2022 2 次提交
  12. 08 2月, 2022 1 次提交
  13. 02 10月, 2021 3 次提交
  14. 29 8月, 2021 1 次提交
  15. 04 7月, 2021 1 次提交
  16. 01 11月, 2020 2 次提交
  17. 13 9月, 2020 1 次提交
    • P
      Update super usage (#2912) · b3c63fbc
      Poruri Sai Rahul 提交于
      On Python 3, super does not need to be called with arguments where as on
      Python 2, super needs to be called with a class object and an instance.
      
      This commit updates the super usage using automated regex-based search
      and replace. After the automated changes were made, each change was
      individually checked before committing.
      b3c63fbc
  18. 10 6月, 2020 1 次提交
  19. 14 5月, 2020 1 次提交
  20. 24 12月, 2019 1 次提交
  21. 24 11月, 2019 4 次提交
  22. 06 10月, 2019 1 次提交
  23. 04 9月, 2019 1 次提交
  24. 18 7月, 2019 1 次提交
  25. 17 6月, 2019 1 次提交
    • R
      mypy: Enable no_implicit_optional · c50aed0f
      Robin Roth 提交于
      "Implicit-optional" mode is on by default, but that default is intended to change in the indefinite future (python/peps#689, python/typing#275). Go ahead and change to the future explicit use of Optional.
      c50aed0f
  26. 22 4月, 2019 1 次提交
  27. 02 3月, 2019 1 次提交
    • B
      Fix importability on python 3.5.2 · 61e1dbf9
      Ben Darnell 提交于
      The "provisional" typing module in 3.5.2 is kind of broken/incomplete
      so we need to use more forward references to avoid confusing it. The
      significance of this version in particular is that it was the one
      included in ubuntu 16.04.
      
      Fixes #2604
      61e1dbf9
  28. 09 2月, 2019 1 次提交
  29. 31 12月, 2018 1 次提交
  30. 21 11月, 2018 1 次提交
  31. 03 11月, 2018 1 次提交