sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.61k stars 2.13k forks source link

Properly strip time zones which are west of UTC #13128

Closed mitya57 closed 1 week ago

mitya57 commented 1 week ago

Feature or Bugfix

Purpose

Properly strip time zones which are west of UTC. Such timezones won’t have + character, they will have - instead.

This fixes test failure which was seen in Debian:

        iso_local = dt.astimezone().isoformat(' ').split('+')[0]
        fd_local = i18n.format_date(fmt, date=dt, language='en', local_time=True)
>       assert fd_local == iso_local
E       AssertionError: assert '2016-08-06 17:11:17' == '2016-08-06 17:11:17-12:00'
E         
E         - 2016-08-06 17:11:17-12:00
E         ?                    ------
E         + 2016-08-06 17:11:17
tests/test_util/test_util_i18n.py:111: AssertionError