[Python-checkins] bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945)
zooba
webhook-mailer at python.org
Fri Mar 18 07:27:30 EDT 2022
https://github.com/python/cpython/commit/d190a9351be577a534a84fd1899f02a9f50f7276
commit: d190a9351be577a534a84fd1899f02a9f50f7276
branch: main
author: Christian Heimes <christian at python.org>
committer: zooba <steve.dower at microsoft.com>
date: 2022-03-18T11:27:20Z
summary:
bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945)
files:
A Misc/NEWS.d/next/Tests/2022-03-16-21-29-30.bpo-47037.xcrLpJ.rst
M Lib/test/support/__init__.py
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 01bb57ec44f0c..fc1b86bebcd1a 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -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
index 0000000000000..f4f28d1e9a012
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-03-16-21-29-30.bpo-47037.xcrLpJ.rst
@@ -0,0 +1,2 @@
+Skip ``strftime("%4Y")`` feature test on Windows. It can cause an assertion
+error in debug builds.
More information about the Python-checkins
mailing list