﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36572	Deprecation of constant_time_compare broke usage with mixed-type arguments.	Sage Abdullah	Sarah Boyce	"The deprecation of `constant_time_compare` in #36546 (0246f478882c26bc1fe293224653074cd46a90d0) removed the `force_bytes` conversion of the arguments passed to the function. The function now raises an error if passed arguments of different types, e.g. `bytes` and `str`. Test:


{{{#!diff
diff --git a/tests/utils_tests/test_crypto.py b/tests/utils_tests/test_crypto.py
index bbedb3080d..4ed8167150 100644
--- a/tests/utils_tests/test_crypto.py
+++ b/tests/utils_tests/test_crypto.py
@@ -21,6 +21,8 @@ class TestUtilsCryptoMisc(SimpleTestCase):
         self.assertFalse(constant_time_compare(b""spam"", b""eggs""))
         self.assertTrue(constant_time_compare(""spam"", ""spam""))
         self.assertFalse(constant_time_compare(""spam"", ""eggs""))
+        self.assertTrue(constant_time_compare(b""spam"", ""spam""))
+        self.assertFalse(constant_time_compare(""spam"", b""eggs""))

     def test_constant_time_compare_deprecated(self):
         msg = (
}}}

The fix on my side is trivial (ensure both arguments are the same type), but I'm not sure if this was intentional for the deprecation process. If it were intentional, I'm happy to close this as a wontfix. Otherwise, I'm also happy to send a PR that adds the `force_bytes` back in."	Bug	closed	Utilities	dev	Release blocker	fixed		Tim Graham Jake Howard JaeHyuckSa	Ready for checkin	1	0	0	0	0	0
