diff --git a/storages/backends/s3.py b/storages/backends/s3.py index fa2d39f16..58bced11a 100644 --- a/storages/backends/s3.py +++ b/storages/backends/s3.py @@ -45,10 +45,12 @@ # NOTE: these are defined as functions so both can be tested def _use_cryptography_signer(): # https://cryptography.io as an RSA backend - from cryptography.hazmat.backends import default_backend - from cryptography.hazmat.primitives import hashes - from cryptography.hazmat.primitives.asymmetric import padding - from cryptography.hazmat.primitives.serialization import load_pem_private_key + from cryptography.hazmat.backends import default_backend # noqa: PLC0415 + from cryptography.hazmat.primitives import hashes # noqa: PLC0415 + from cryptography.hazmat.primitives.asymmetric import padding # noqa: PLC0415 + from cryptography.hazmat.primitives.serialization import ( # noqa: PLC0415 + load_pem_private_key, + ) def _cloud_front_signer_from_pem(key_id, pem): if isinstance(pem, str): @@ -64,7 +66,7 @@ def _cloud_front_signer_from_pem(key_id, pem): def _use_rsa_signer(): # https://stuvel.eu/rsa as an RSA backend - import rsa + import rsa # noqa: PLC0415 def _cloud_front_signer_from_pem(key_id, pem): if isinstance(pem, str): diff --git a/tests/test_utils.py b/tests/test_utils.py index 0895356ed..c1076aca8 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -189,7 +189,7 @@ def test_with_string_file(self): # bytes when encoding with utf-8 vs windows-1252 vs utf-16 def test_with_string_file_specified_encoding(self): - content = "\u2122\u20AC\u2030" + content = "\u2122\u20ac\u2030" file = io.StringIO(content) file_wrapped = utils.ReadBytesWrapper(file, encoding="utf-16") @@ -197,7 +197,7 @@ def test_with_string_file_specified_encoding(self): self.assertEqual(file_wrapped.read(), content.encode("utf-16")) def test_with_string_file_detect_encoding(self): - content = "\u2122\u20AC\u2030" + content = "\u2122\u20ac\u2030" with open( file=os.path.join( os.path.dirname(__file__), "test_files", "windows-1252-encoded.txt" @@ -214,7 +214,7 @@ def test_with_string_file_detect_encoding(self): self.assertEqual(file_wrapped.read(), content.encode("windows-1252")) def test_with_string_file_fallback_encoding(self): - content = "\u2122\u20AC\u2030" + content = "\u2122\u20ac\u2030" file = io.StringIO(content) file_wrapped = utils.ReadBytesWrapper(file)