We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Drop Wheezy Builder?
Wheezy is EOL as of May 31, 2018 (https://wiki.debian.org/LTS). Should we drop it out of our test matrix going forward? We still have OpenSSL 1.0.1 coverage through building on Ubuntu 14.04 (supported through April 2019).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/cryptography/utils.py`
Content:
```
1 # This file is dual licensed under the terms of the Apache License, Version
2 # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 # for complete details.
4 
5 from __future__ import absolute_import, division, print_function
6 
7 import abc
8 import binascii
9 import inspect
10 import sys
11 import warnings
12 
13 
14 # We use a UserWarning subclass, instead of DeprecationWarning, because CPython
15 # decided deprecation warnings should be invisble by default.
16 class CryptographyDeprecationWarning(UserWarning):
17     pass
18 
19 
20 # Several APIs were deprecated with no specific end-of-life date because of the
21 # ubiquity of their use. They should not be removed until we agree on when that
22 # cycle ends.
23 PersistentlyDeprecated = CryptographyDeprecationWarning
24 DeprecatedIn21 = CryptographyDeprecationWarning
25 
26 
27 def _check_bytes(name, value):
28     if not isinstance(value, bytes):
29         raise TypeError("{0} must be bytes".format(name))
30 
31 
32 def read_only_property(name):
33     return property(lambda self: getattr(self, name))
34 
35 
36 def register_interface(iface):
37     def register_decorator(klass):
38         verify_interface(iface, klass)
39         iface.register(klass)
40         return klass
41     return register_decorator
42 
43 
44 def register_interface_if(predicate, iface):
45     def register_decorator(klass):
46         if predicate:
47             verify_interface(iface, klass)
48             iface.register(klass)
49         return klass
50     return register_decorator
51 
52 
53 if hasattr(int, "from_bytes"):
54     int_from_bytes = int.from_bytes
55 else:
56     def int_from_bytes(data, byteorder, signed=False):
57         assert byteorder == 'big'
58         assert not signed
59 
60         return int(binascii.hexlify(data), 16)
61 
62 
63 if hasattr(int, "to_bytes"):
64     def int_to_bytes(integer, length=None):
65         return integer.to_bytes(
66             length or (integer.bit_length() + 7) // 8 or 1, 'big'
67         )
68 else:
69     def int_to_bytes(integer, length=None):
70         hex_string = '%x' % integer
71         if length is None:
72             n = len(hex_string)
73         else:
74             n = length * 2
75         return binascii.unhexlify(hex_string.zfill(n + (n & 1)))
76 
77 
78 class InterfaceNotImplemented(Exception):
79     pass
80 
81 
82 if hasattr(inspect, "signature"):
83     signature = inspect.signature
84 else:
85     signature = inspect.getargspec
86 
87 
88 def verify_interface(iface, klass):
89     for method in iface.__abstractmethods__:
90         if not hasattr(klass, method):
91             raise InterfaceNotImplemented(
92                 "{0} is missing a {1!r} method".format(klass, method)
93             )
94         if isinstance(getattr(iface, method), abc.abstractproperty):
95             # Can't properly verify these yet.
96             continue
97         sig = signature(getattr(iface, method))
98         actual = signature(getattr(klass, method))
99         if sig != actual:
100             raise InterfaceNotImplemented(
101                 "{0}.{1}'s signature differs from the expected. Expected: "
102                 "{2!r}. Received: {3!r}".format(
103                     klass, method, sig, actual
104                 )
105             )
106 
107 
108 # No longer needed as of 2.2, but retained because we have external consumers
109 # who use it.
110 def bit_length(x):
111     return x.bit_length()
112 
113 
114 class _DeprecatedValue(object):
115     def __init__(self, value, message, warning_class):
116         self.value = value
117         self.message = message
118         self.warning_class = warning_class
119 
120 
121 class _ModuleWithDeprecations(object):
122     def __init__(self, module):
123         self.__dict__["_module"] = module
124 
125     def __getattr__(self, attr):
126         obj = getattr(self._module, attr)
127         if isinstance(obj, _DeprecatedValue):
128             warnings.warn(obj.message, obj.warning_class, stacklevel=2)
129             obj = obj.value
130         return obj
131 
132     def __setattr__(self, attr, value):
133         setattr(self._module, attr, value)
134 
135     def __delattr__(self, attr):
136         obj = getattr(self._module, attr)
137         if isinstance(obj, _DeprecatedValue):
138             warnings.warn(obj.message, obj.warning_class, stacklevel=2)
139 
140         delattr(self._module, attr)
141 
142     def __dir__(self):
143         return ["_module"] + dir(self._module)
144 
145 
146 def deprecated(value, module_name, message, warning_class):
147     module = sys.modules[module_name]
148     if not isinstance(module, _ModuleWithDeprecations):
149         sys.modules[module_name] = _ModuleWithDeprecations(module)
150     return _DeprecatedValue(value, message, warning_class)
151 
152 
153 def cached_property(func):
154     cached_name = "_cached_{0}".format(func)
155     sentinel = object()
156 
157     def inner(instance):
158         cache = getattr(instance, cached_name, sentinel)
159         if cache is not sentinel:
160             return cache
161         result = func(instance)
162         setattr(instance, cached_name, result)
163         return result
164     return property(inner)
165
```

Path: `src/cryptography/hazmat/primitives/constant_time.py`
Content:
```
1 # This file is dual licensed under the terms of the Apache License, Version
2 # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 # for complete details.
4 
5 from __future__ import absolute_import, division, print_function
6 
7 import hmac
8 
9 from cryptography.hazmat.bindings._constant_time import lib
10 
11 
12 if hasattr(hmac, "compare_digest"):
13     def bytes_eq(a, b):
14         if not isinstance(a, bytes) or not isinstance(b, bytes):
15             raise TypeError("a and b must be bytes.")
16 
17         return hmac.compare_digest(a, b)
18 
19 else:
20     def bytes_eq(a, b):
21         if not isinstance(a, bytes) or not isinstance(b, bytes):
22             raise TypeError("a and b must be bytes.")
23 
24         return lib.Cryptography_constant_time_bytes_eq(
25             a, len(a), b, len(b)
26         ) == 1
27
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/cryptography/hazmat/primitives/constant_time.py b/src/cryptography/hazmat/primitives/constant_time.py
--- a/src/cryptography/hazmat/primitives/constant_time.py
+++ b/src/cryptography/hazmat/primitives/constant_time.py
@@ -5,7 +5,9 @@
 from __future__ import absolute_import, division, print_function
 
 import hmac
+import warnings
 
+from cryptography import utils
 from cryptography.hazmat.bindings._constant_time import lib
 
 
@@ -17,6 +19,13 @@
         return hmac.compare_digest(a, b)
 
 else:
+    warnings.warn(
+        "Support for your Python version is deprecated. The next version of "
+        "cryptography will remove support. Please upgrade to a 2.7.x "
+        "release that supports hmac.compare_digest as soon as possible.",
+        utils.DeprecatedIn23,
+    )
+
     def bytes_eq(a, b):
         if not isinstance(a, bytes) or not isinstance(b, bytes):
             raise TypeError("a and b must be bytes.")
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -22,6 +22,7 @@
 # cycle ends.
 PersistentlyDeprecated = CryptographyDeprecationWarning
 DeprecatedIn21 = CryptographyDeprecationWarning
+DeprecatedIn23 = CryptographyDeprecationWarning
 
 
 def _check_bytes(name, value):

{"golden_diff": "diff --git a/src/cryptography/hazmat/primitives/constant_time.py b/src/cryptography/hazmat/primitives/constant_time.py\n--- a/src/cryptography/hazmat/primitives/constant_time.py\n+++ b/src/cryptography/hazmat/primitives/constant_time.py\n@@ -5,7 +5,9 @@\n from __future__ import absolute_import, division, print_function\n \n import hmac\n+import warnings\n \n+from cryptography import utils\n from cryptography.hazmat.bindings._constant_time import lib\n \n \n@@ -17,6 +19,13 @@\n         return hmac.compare_digest(a, b)\n \n else:\n+    warnings.warn(\n+        \"Support for your Python version is deprecated. The next version of \"\n+        \"cryptography will remove support. Please upgrade to a 2.7.x \"\n+        \"release that supports hmac.compare_digest as soon as possible.\",\n+        utils.DeprecatedIn23,\n+    )\n+\n     def bytes_eq(a, b):\n         if not isinstance(a, bytes) or not isinstance(b, bytes):\n             raise TypeError(\"a and b must be bytes.\")\ndiff --git a/src/cryptography/utils.py b/src/cryptography/utils.py\n--- a/src/cryptography/utils.py\n+++ b/src/cryptography/utils.py\n@@ -22,6 +22,7 @@\n # cycle ends.\n PersistentlyDeprecated = CryptographyDeprecationWarning\n DeprecatedIn21 = CryptographyDeprecationWarning\n+DeprecatedIn23 = CryptographyDeprecationWarning\n \n \n def _check_bytes(name, value):\n", "issue": "Drop Wheezy Builder?\nWheezy is EOL as of May 31, 2018 (https://wiki.debian.org/LTS). Should we drop it out of our test matrix going forward? We still have OpenSSL 1.0.1 coverage through building on Ubuntu 14.04 (supported through April 2019).\n", "before_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport abc\nimport binascii\nimport inspect\nimport sys\nimport warnings\n\n\n# We use a UserWarning subclass, instead of DeprecationWarning, because CPython\n# decided deprecation warnings should be invisble by default.\nclass CryptographyDeprecationWarning(UserWarning):\n    pass\n\n\n# Several APIs were deprecated with no specific end-of-life date because of the\n# ubiquity of their use. They should not be removed until we agree on when that\n# cycle ends.\nPersistentlyDeprecated = CryptographyDeprecationWarning\nDeprecatedIn21 = CryptographyDeprecationWarning\n\n\ndef _check_bytes(name, value):\n    if not isinstance(value, bytes):\n        raise TypeError(\"{0} must be bytes\".format(name))\n\n\ndef read_only_property(name):\n    return property(lambda self: getattr(self, name))\n\n\ndef register_interface(iface):\n    def register_decorator(klass):\n        verify_interface(iface, klass)\n        iface.register(klass)\n        return klass\n    return register_decorator\n\n\ndef register_interface_if(predicate, iface):\n    def register_decorator(klass):\n        if predicate:\n            verify_interface(iface, klass)\n            iface.register(klass)\n        return klass\n    return register_decorator\n\n\nif hasattr(int, \"from_bytes\"):\n    int_from_bytes = int.from_bytes\nelse:\n    def int_from_bytes(data, byteorder, signed=False):\n        assert byteorder == 'big'\n        assert not signed\n\n        return int(binascii.hexlify(data), 16)\n\n\nif hasattr(int, \"to_bytes\"):\n    def int_to_bytes(integer, length=None):\n        return integer.to_bytes(\n            length or (integer.bit_length() + 7) // 8 or 1, 'big'\n        )\nelse:\n    def int_to_bytes(integer, length=None):\n        hex_string = '%x' % integer\n        if length is None:\n            n = len(hex_string)\n        else:\n            n = length * 2\n        return binascii.unhexlify(hex_string.zfill(n + (n & 1)))\n\n\nclass InterfaceNotImplemented(Exception):\n    pass\n\n\nif hasattr(inspect, \"signature\"):\n    signature = inspect.signature\nelse:\n    signature = inspect.getargspec\n\n\ndef verify_interface(iface, klass):\n    for method in iface.__abstractmethods__:\n        if not hasattr(klass, method):\n            raise InterfaceNotImplemented(\n                \"{0} is missing a {1!r} method\".format(klass, method)\n            )\n        if isinstance(getattr(iface, method), abc.abstractproperty):\n            # Can't properly verify these yet.\n            continue\n        sig = signature(getattr(iface, method))\n        actual = signature(getattr(klass, method))\n        if sig != actual:\n            raise InterfaceNotImplemented(\n                \"{0}.{1}'s signature differs from the expected. Expected: \"\n                \"{2!r}. Received: {3!r}\".format(\n                    klass, method, sig, actual\n                )\n            )\n\n\n# No longer needed as of 2.2, but retained because we have external consumers\n# who use it.\ndef bit_length(x):\n    return x.bit_length()\n\n\nclass _DeprecatedValue(object):\n    def __init__(self, value, message, warning_class):\n        self.value = value\n        self.message = message\n        self.warning_class = warning_class\n\n\nclass _ModuleWithDeprecations(object):\n    def __init__(self, module):\n        self.__dict__[\"_module\"] = module\n\n    def __getattr__(self, attr):\n        obj = getattr(self._module, attr)\n        if isinstance(obj, _DeprecatedValue):\n            warnings.warn(obj.message, obj.warning_class, stacklevel=2)\n            obj = obj.value\n        return obj\n\n    def __setattr__(self, attr, value):\n        setattr(self._module, attr, value)\n\n    def __delattr__(self, attr):\n        obj = getattr(self._module, attr)\n        if isinstance(obj, _DeprecatedValue):\n            warnings.warn(obj.message, obj.warning_class, stacklevel=2)\n\n        delattr(self._module, attr)\n\n    def __dir__(self):\n        return [\"_module\"] + dir(self._module)\n\n\ndef deprecated(value, module_name, message, warning_class):\n    module = sys.modules[module_name]\n    if not isinstance(module, _ModuleWithDeprecations):\n        sys.modules[module_name] = _ModuleWithDeprecations(module)\n    return _DeprecatedValue(value, message, warning_class)\n\n\ndef cached_property(func):\n    cached_name = \"_cached_{0}\".format(func)\n    sentinel = object()\n\n    def inner(instance):\n        cache = getattr(instance, cached_name, sentinel)\n        if cache is not sentinel:\n            return cache\n        result = func(instance)\n        setattr(instance, cached_name, result)\n        return result\n    return property(inner)\n", "path": "src/cryptography/utils.py"}, {"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport hmac\n\nfrom cryptography.hazmat.bindings._constant_time import lib\n\n\nif hasattr(hmac, \"compare_digest\"):\n    def bytes_eq(a, b):\n        if not isinstance(a, bytes) or not isinstance(b, bytes):\n            raise TypeError(\"a and b must be bytes.\")\n\n        return hmac.compare_digest(a, b)\n\nelse:\n    def bytes_eq(a, b):\n        if not isinstance(a, bytes) or not isinstance(b, bytes):\n            raise TypeError(\"a and b must be bytes.\")\n\n        return lib.Cryptography_constant_time_bytes_eq(\n            a, len(a), b, len(b)\n        ) == 1\n", "path": "src/cryptography/hazmat/primitives/constant_time.py"}], "after_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport abc\nimport binascii\nimport inspect\nimport sys\nimport warnings\n\n\n# We use a UserWarning subclass, instead of DeprecationWarning, because CPython\n# decided deprecation warnings should be invisble by default.\nclass CryptographyDeprecationWarning(UserWarning):\n    pass\n\n\n# Several APIs were deprecated with no specific end-of-life date because of the\n# ubiquity of their use. They should not be removed until we agree on when that\n# cycle ends.\nPersistentlyDeprecated = CryptographyDeprecationWarning\nDeprecatedIn21 = CryptographyDeprecationWarning\nDeprecatedIn23 = CryptographyDeprecationWarning\n\n\ndef _check_bytes(name, value):\n    if not isinstance(value, bytes):\n        raise TypeError(\"{0} must be bytes\".format(name))\n\n\ndef read_only_property(name):\n    return property(lambda self: getattr(self, name))\n\n\ndef register_interface(iface):\n    def register_decorator(klass):\n        verify_interface(iface, klass)\n        iface.register(klass)\n        return klass\n    return register_decorator\n\n\ndef register_interface_if(predicate, iface):\n    def register_decorator(klass):\n        if predicate:\n            verify_interface(iface, klass)\n            iface.register(klass)\n        return klass\n    return register_decorator\n\n\nif hasattr(int, \"from_bytes\"):\n    int_from_bytes = int.from_bytes\nelse:\n    def int_from_bytes(data, byteorder, signed=False):\n        assert byteorder == 'big'\n        assert not signed\n\n        return int(binascii.hexlify(data), 16)\n\n\nif hasattr(int, \"to_bytes\"):\n    def int_to_bytes(integer, length=None):\n        return integer.to_bytes(\n            length or (integer.bit_length() + 7) // 8 or 1, 'big'\n        )\nelse:\n    def int_to_bytes(integer, length=None):\n        hex_string = '%x' % integer\n        if length is None:\n            n = len(hex_string)\n        else:\n            n = length * 2\n        return binascii.unhexlify(hex_string.zfill(n + (n & 1)))\n\n\nclass InterfaceNotImplemented(Exception):\n    pass\n\n\nif hasattr(inspect, \"signature\"):\n    signature = inspect.signature\nelse:\n    signature = inspect.getargspec\n\n\ndef verify_interface(iface, klass):\n    for method in iface.__abstractmethods__:\n        if not hasattr(klass, method):\n            raise InterfaceNotImplemented(\n                \"{0} is missing a {1!r} method\".format(klass, method)\n            )\n        if isinstance(getattr(iface, method), abc.abstractproperty):\n            # Can't properly verify these yet.\n            continue\n        sig = signature(getattr(iface, method))\n        actual = signature(getattr(klass, method))\n        if sig != actual:\n            raise InterfaceNotImplemented(\n                \"{0}.{1}'s signature differs from the expected. Expected: \"\n                \"{2!r}. Received: {3!r}\".format(\n                    klass, method, sig, actual\n                )\n            )\n\n\n# No longer needed as of 2.2, but retained because we have external consumers\n# who use it.\ndef bit_length(x):\n    return x.bit_length()\n\n\nclass _DeprecatedValue(object):\n    def __init__(self, value, message, warning_class):\n        self.value = value\n        self.message = message\n        self.warning_class = warning_class\n\n\nclass _ModuleWithDeprecations(object):\n    def __init__(self, module):\n        self.__dict__[\"_module\"] = module\n\n    def __getattr__(self, attr):\n        obj = getattr(self._module, attr)\n        if isinstance(obj, _DeprecatedValue):\n            warnings.warn(obj.message, obj.warning_class, stacklevel=2)\n            obj = obj.value\n        return obj\n\n    def __setattr__(self, attr, value):\n        setattr(self._module, attr, value)\n\n    def __delattr__(self, attr):\n        obj = getattr(self._module, attr)\n        if isinstance(obj, _DeprecatedValue):\n            warnings.warn(obj.message, obj.warning_class, stacklevel=2)\n\n        delattr(self._module, attr)\n\n    def __dir__(self):\n        return [\"_module\"] + dir(self._module)\n\n\ndef deprecated(value, module_name, message, warning_class):\n    module = sys.modules[module_name]\n    if not isinstance(module, _ModuleWithDeprecations):\n        sys.modules[module_name] = _ModuleWithDeprecations(module)\n    return _DeprecatedValue(value, message, warning_class)\n\n\ndef cached_property(func):\n    cached_name = \"_cached_{0}\".format(func)\n    sentinel = object()\n\n    def inner(instance):\n        cache = getattr(instance, cached_name, sentinel)\n        if cache is not sentinel:\n            return cache\n        result = func(instance)\n        setattr(instance, cached_name, result)\n        return result\n    return property(inner)\n", "path": "src/cryptography/utils.py"}, {"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport hmac\nimport warnings\n\nfrom cryptography import utils\nfrom cryptography.hazmat.bindings._constant_time import lib\n\n\nif hasattr(hmac, \"compare_digest\"):\n    def bytes_eq(a, b):\n        if not isinstance(a, bytes) or not isinstance(b, bytes):\n            raise TypeError(\"a and b must be bytes.\")\n\n        return hmac.compare_digest(a, b)\n\nelse:\n    warnings.warn(\n        \"Support for your Python version is deprecated. The next version of \"\n        \"cryptography will remove support. Please upgrade to a 2.7.x \"\n        \"release that supports hmac.compare_digest as soon as possible.\",\n        utils.DeprecatedIn23,\n    )\n\n    def bytes_eq(a, b):\n        if not isinstance(a, bytes) or not isinstance(b, bytes):\n            raise TypeError(\"a and b must be bytes.\")\n\n        return lib.Cryptography_constant_time_bytes_eq(\n            a, len(a), b, len(b)\n        ) == 1\n", "path": "src/cryptography/hazmat/primitives/constant_time.py"}]}