8000 bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945) · python/cpython@d190a93 · GitHub
[go: up one dir, main page]

Skip to content

Commit d190a93

Browse files
authored
bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945)
1 parent 2217462 commit d190a93

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Lib/test/support/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,13 @@ def requires_subprocess():
521521
return unittest.skipUnless(has_subprocess_support, "requires subprocess support")
522522

523523
# Does strftime() support glibc extension like '%4Y'?
524-
try:
525-
has_strftime_extensions = time.strftime("%4Y") != "%4Y"
526-
except ValueError:
527-
has_strftime_extensions = False
524+
has_strftime_extensions = False
525+
if sys.platform != "win32":
526+
# bpo-47037: Windows debug builds crash with "Debug Assertion Failed"
527+
try:
528+
has_strftime_extensions = time.strftime("%4Y") != "%4Y"
529+
except ValueError:
530+
pass
528531

529532
# Define the URL of a dedicated HTTP server for the network tests.
530533
# The URL must use clear-text HTTP: no redirection to encrypted HTTPS.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Skip ``strftime("%4Y")`` feature test on Windows. It can cause an assertion
2+
error in debug builds.

0 commit comments

Comments
 (0)
0