summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email/test_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-113027: Fix timezone check in test_variable_tzname in test_email (GH-113835)Pablo Galindo Salgado2024-01-121-1/+1
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-113027: Fix test_variable_tzname in test_email (#113821)Serhiy Storchaka2024-01-081-2/+2
| | | | | Determine the support of the Kyiv timezone by checking the result of astimezone() which uses the system tz database and not the one populated by zoneinfo.
* gh-109017: Use non alternate name for Kyiv (GH-109251)Jochen Sprickerhof2023-10-241-7/+4
| | | | | | | | | | | | tzdata provides Kiev as an alternative to Kyiv: https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314#L314 But Debian moved it to the tzdata-legacy package breaking the test: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530 This patch switches to the name provided by tzdata. Also check that the new name is actually available.
* Revert "Use non alternate name for Kyiv (GH-108533)" (GH-108649)Serhiy Storchaka2023-08-291-1/+1
| | | | | This reverts commit 7659128b9d7a30ddbcb063bc12e2ddb0f1f119e0. It broke tests on the Debian and macOS buildbots.
* Use non alternate name for Kyiv (GH-108533)Jochen Sprickerhof2023-08-291-1/+1
| | | | | | | | | | | tzdata provides Kiev as an alternative to Kyiv: https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314#L314 But Debian moved it to the tzdata-legacy package breaking the test: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530 This patch switches to the name provided by tzdata.
* gh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450)Alan Williams2023-03-201-4/+9
|
* gh-95087: Fix IndexError in parsing invalid date in the email module (GH-95201)Serhiy Storchaka2022-07-251-6/+15
| | | | Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
* bpo-30681: Support invalid date format or value in email Date header (GH-22090)Georges Toth2020-10-271-0/+10
| | | | | | | | | | | | | | | | | | | | I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07. The issue being solved () is still relevant. The original PR #10783 was closed as the final request changes were not applied and since abandoned. In this new PR I have re-used the original patch plus applied both comments from the review, by @maxking and @pganssle. For reference, here is the original PR description: In email.utils.parsedate_to_datetime(), a failure to parse the date, or invalid date components (such as hour outside 0..23) raises an exception. Document this behaviour, and add tests to test_email/test_utils.py to confirm this behaviour. In email.headerregistry.DateHeader.parse(), check when parsedate_to_datetime() raises an exception and add a new defect InvalidDateDefect; preserve the invalid value as the string value of the header, but set the datetime attribute to None. Add tests to test_email/test_headerregistry.py to confirm this behaviour; also added test to test_email/test_inversion.py to confirm emails with such defective date headers round trip successfully. This pull request incorporates feedback gratefully received from @bitdancer, @brettcannon, @Mariatta and @warsaw, and replaces the earlier PR #2254. Automerge-Triggered-By: GH:warsaw
* bpo-35317: Fix mktime() error in test_email (GH-10721)Victor Stinner2018-11-271-0/+2
| | | | | Fix mktime() overflow error in test_email: run test_localtime_daylight_true_dst_true() and test_localtime_daylight_false_dst_true() with a specific timezone.
* Issue #24836: Skip FormatDateTests of test_email.test_utils on Mac OS X SnowVictor Stinner2015-09-181-0/+3
| | | | Leopard because this OS uses out of date (pre 2011k) timezone files.
* Issue #22932: Fix timezones in email.utils.formatdate.Robert Collins2015-07-311-0/+20
| | | | Patch from Dmitry Shachnev.
* Issue #19590: Use specific asserts in email tests.Serhiy Storchaka2013-11-161-2/+2
|
* #17877: skip test if the Olson's TZ database is missing.Ezio Melotti2013-05-081-0/+4
|
* Close #15165: Fix test_email on Windows 64 bitsVictor Stinner2012-11-051-4/+4
| | | | Use year 1990 instead of year 1970 to avoid issues with negative timestamps.
* Added test for a bug fixed in issue #665194.Alexander Belopolsky2012-08-231-0/+12
|
* #665194: Update email.utils.localtime to use astimezone, and fix bug.R David Murray2012-08-231-2/+8
| | | | | | | The new code correctly handles historic changes in UTC offsets. A test for this should follow. Original patch by Alexander Belopolsky.
* #665194: Add a localtime function to email.utils.R David Murray2012-05-261-0/+73
| | | | | | | | Without this function people would be tempted to use the other date functions in email.utils to compute an aware localtime, and those functions are not as good for that purpose as this code. The code is Alexander Belopolsy's from his proposed patch for issue 9527, with a fix (and additional tests) by Brian K. Jones.
* #665194: support roundtripping RFC2822 date stamps in the email.utils moduleR David Murray2011-07-201-0/+45