| 1 |
Description: tzdata's new update in debian has removed support for US/* timezones |
| 2 |
Author: Nilesh Patra <[email protected]> |
| 3 |
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052858 |
| 4 |
Last-Update: 2023-10-10 |
| 5 |
--- a/babel/dates.py |
| 6 |
+++ b/babel/dates.py |
| 7 |
@@ -743,7 +743,7 @@ |
| 8 |
... locale='fr_FR') |
| 9 |
'dimanche 1 avril 2007, 17:30:00 heure d’été d’Europe centrale' |
| 10 |
>>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz", |
| 11 |
- ... tzinfo=get_timezone('US/Eastern'), locale='en') |
| 12 |
+ ... tzinfo=get_timezone('America/New_York'), locale='en') |
| 13 |
'2007.04.01 AD at 11:30:00 EDT' |
| 14 |
|
| 15 |
:param datetime: the `datetime` object; if `None`, the current date and |
| 16 |
@@ -796,7 +796,7 @@ |
| 17 |
>>> t = _localize(tzinfo, t) |
| 18 |
>>> format_time(t, format='full', tzinfo=tzinfo, locale='fr_FR') |
| 19 |
'15:30:00 heure d’été d’Europe centrale' |
| 20 |
- >>> format_time(t, "hh 'o''clock' a, zzzz", tzinfo=get_timezone('US/Eastern'), |
| 21 |
+ >>> format_time(t, "hh 'o''clock' a, zzzz", tzinfo=get_timezone('America/New_York'), |
| 22 |
... locale='en') |
| 23 |
"09 o'clock AM, Eastern Daylight Time" |
| 24 |
|
| 25 |
@@ -817,7 +817,7 @@ |
| 26 |
>>> format_time(t, format='full', tzinfo=get_timezone('Europe/Paris'), |
| 27 |
... locale='fr_FR') # doctest: +SKIP |
| 28 |
'15:30:00 heure normale d\u2019Europe centrale' |
| 29 |
- >>> format_time(t, format='full', tzinfo=get_timezone('US/Eastern'), |
| 30 |
+ >>> format_time(t, format='full', tzinfo=get_timezone('America/New_York'), |
| 31 |
... locale='en_US') # doctest: +SKIP |
| 32 |
'3:30:00\u202fPM Eastern Standard Time' |
| 33 |
|
| 34 |
--- a/babel/support.py |
| 35 |
+++ b/babel/support.py |
| 36 |
@@ -91,7 +91,7 @@ |
| 37 |
|
| 38 |
>>> from datetime import datetime |
| 39 |
>>> from babel.dates import get_timezone |
| 40 |
- >>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern')) |
| 41 |
+ >>> fmt = Format('en_US', tzinfo=get_timezone('America/New_York')) |
| 42 |
>>> fmt.datetime(datetime(2007, 4, 1, 15, 30)) |
| 43 |
'Apr 1, 2007, 11:30:00\\u202fAM' |
| 44 |
""" |
| 45 |
@@ -106,7 +106,7 @@ |
| 46 |
|
| 47 |
>>> from datetime import datetime |
| 48 |
>>> from babel.dates import get_timezone |
| 49 |
- >>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern')) |
| 50 |
+ >>> fmt = Format('en_US', tzinfo=get_timezone('America/New_York')) |
| 51 |
>>> fmt.time(datetime(2007, 4, 1, 15, 30)) |
| 52 |
'11:30:00\\u202fAM' |
| 53 |
""" |
| 54 |
--- a/docs/dates.rst |
| 55 |
+++ b/docs/dates.rst |
| 56 |
@@ -285,7 +285,7 @@ |
| 57 |
>>> from datetime import time |
| 58 |
>>> from babel.dates import get_timezone, UTC |
| 59 |
>>> dt = datetime(2007, 4, 1, 15, 30, tzinfo=UTC) |
| 60 |
- >>> eastern = get_timezone('US/Eastern') |
| 61 |
+ >>> eastern = get_timezone('America/New_York') |
| 62 |
>>> format_datetime(dt, 'H:mm Z', tzinfo=eastern, locale='en_US') |
| 63 |
'11:30 -0400' |
| 64 |
|
| 65 |
--- a/tests/test_dates.py |
| 66 |
+++ b/tests/test_dates.py |
| 67 |
@@ -329,7 +329,7 @@ |
| 68 |
assert dates.format_time( |
| 69 |
datetime(2007, 4, 1, 15, 30), |
| 70 |
'long', |
| 71 |
- tzinfo=timezone_getter('US/Eastern'), |
| 72 |
+ tzinfo=timezone_getter('America/New_York'), |
| 73 |
locale='en', |
| 74 |
) == '11:30:00 AM EDT' |
| 75 |
|
| 76 |
@@ -577,7 +577,7 @@ |
| 77 |
) |
| 78 |
custom = dates.format_datetime( |
| 79 |
dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz", |
| 80 |
- tzinfo=timezone_getter('US/Eastern'), |
| 81 |
+ tzinfo=timezone_getter('America/New_York'), |
| 82 |
locale='en', |
| 83 |
) |
| 84 |
assert custom == '2007.04.01 AD at 11:30:00 EDT' |
| 85 |
@@ -592,7 +592,7 @@ |
| 86 |
"03 o'clock PM") |
| 87 |
|
| 88 |
paris = timezone_getter('Europe/Paris') |
| 89 |
- eastern = timezone_getter('US/Eastern') |
| 90 |
+ eastern = timezone_getter('America/New_York') |
| 91 |
|
| 92 |
t = _localize(paris, datetime(2007, 4, 1, 15, 30)) |
| 93 |
fr = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR') |
| 94 |
--- a/tests/test_support_format.py |
| 95 |
+++ b/tests/test_support_format.py |
| 96 |
@@ -13,7 +13,7 @@ |
| 97 |
|
| 98 |
@pytest.fixture |
| 99 |
def en_us_format(timezone_getter) -> support.Format: |
| 100 |
- return support.Format('en_US', tzinfo=timezone_getter('US/Eastern')) |
| 101 |
+ return support.Format('en_US', tzinfo=timezone_getter('America/New_York')) |
| 102 |
|
| 103 |
|
| 104 |
def test_format_datetime(en_us_format): |