This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: datetime and time tests use non-portable "%4Y" format
Type: behavior Stage: patch review
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes
Priority: normal Keywords: patch

Created on 2022-01-30 15:14 by christian.heimes, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 31873 merged christian.heimes, 2022-03-14 16:12
Messages (2)
msg412157 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2022-01-30 15:14
Several test cases for datetime and time modules use the non-standard and non-portal width prefix for strftime:

>>>, 1, 1).strftime("%4Y")

According to man strftime(3) the width field is glibc-specific extension:

> Glibc provides some extensions for conversion specifications.
> (These extensions are not specified in POSIX.1-2001, but a few
> other systems provide similar features.)  Between the '%'
> character and the conversion specifier character, an optional
> flag and field width may be specified.

The width field is not supported by Emscripten, which only implements POSIX.1-2001 compatible date and time formatting:

Python 3.11.0a4+ (heads/main-dirty:b1a3446, Jan 25 2022, 10:19:07) [Clang 14.0.0 ( f142c45f1e494f8dbdcc1bcf1412 on emscripten
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>>, 1, 1).strftime("%4Y")

Also see bpo-13305
msg415229 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2022-03-15 09:41
New changeset 2cf7f865f099db11cc6903b334d9c376610313e8 by Christian Heimes in branch 'main':
bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873)
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90745
2022-03-15 09:41:15christian.heimessetmessages: + msg415229
2022-03-14 16:12:53christian.heimessetkeywords: + patch
stage: patch review
pull_requests: + pull_request29971
2022-02-04 18:34:58eric.araujosettitle: datetime and time tests use non-portal "%4Y" format -> datetime and time tests use non-portable "%4Y" format
2022-01-30 15:14:48christian.heimescreate