]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945)
authorChristian Heimes <christian@python.org>
Fri, 18 Mar 2022 11:27:20 +0000 (13:27 +0200)
committerGitHub <noreply@github.com>
Fri, 18 Mar 2022 11:27:20 +0000 (11:27 +0000)
Lib/test/support/__init__.py
Misc/NEWS.d/next/Tests/2022-03-16-21-29-30.bpo-47037.xcrLpJ.rst [new file with mode: 0644]

index 01bb57ec44f0c940744afd3505fa9c392e86372a..fc1b86bebcd1aec373c145a97e4424ceef132452 100644 (file)
@@ -521,10 +521,13 @@ def requires_subprocess():
     return unittest.skipUnless(has_subprocess_support, "requires subprocess support")
 
 # Does strftime() support glibc extension like '%4Y'?
-try:
-    has_strftime_extensions = time.strftime("%4Y") != "%4Y"
-except ValueError:
-    has_strftime_extensions = False
+has_strftime_extensions = False
+if sys.platform != "win32":
+    # bpo-47037: Windows debug builds crash with "Debug Assertion Failed"
+    try:
+        has_strftime_extensions = time.strftime("%4Y") != "%4Y"
+    except ValueError:
+        pass
 
 # Define the URL of a dedicated HTTP server for the network tests.
 # The URL must use clear-text HTTP: no redirection to encrypted HTTPS.
diff --git a/Misc/NEWS.d/next/Tests/2022-03-16-21-29-30.bpo-47037.xcrLpJ.rst b/Misc/NEWS.d/next/Tests/2022-03-16-21-29-30.bpo-47037.xcrLpJ.rst
new file mode 100644 (file)
index 0000000..f4f28d1
--- /dev/null
@@ -0,0 +1,2 @@
+Skip ``strftime("%4Y")`` feature test on Windows. It can cause an assertion
+error in debug builds.