From a4648d1816f73529a9af8bea3497e7fb6055a905 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Wed, 15 Oct 2025 11:36:37 -0700 Subject: [PATCH 1/3] Renove unused CACertsHTTPSConnection class Should have been removed in #372 --- shotgun_api3/shotgun.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index 67996c9f..5b782420 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -4505,41 +4505,6 @@ def _send_form(self, url, params): raise ShotgunError("Max attemps limit reached.") -class CACertsHTTPSConnection(http.client.HTTPConnection): - """ " - This class allows to create an HTTPS connection that uses the custom certificates - passed in. - """ - - default_port = http.client.HTTPS_PORT - - def __init__(self, *args, **kwargs): - """ - :param args: Positional arguments passed down to the base class. - :param ca_certs: Path to the custom CA certs file. - :param kwargs: Keyword arguments passed down to the bas class - """ - # Pop that argument, - self.__ca_certs = kwargs.pop("ca_certs") - super().__init__(self, *args, **kwargs) - - def connect(self): - "Connect to a host on a given (SSL) port." - super().connect(self) - # Now that the regular HTTP socket has been created, wrap it with our SSL certs. - if (sys.version_info.major, sys.version_info.minor) >= (3, 8): - context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) - context.verify_mode = ssl.CERT_REQUIRED - context.check_hostname = False - if self.__ca_certs: - context.load_verify_locations(self.__ca_certs) - self.sock = context.wrap_socket(self.sock) - else: - self.sock = ssl.wrap_socket( - self.sock, ca_certs=self.__ca_certs, cert_reqs=ssl.CERT_REQUIRED - ) - - # Helpers from the previous API, left as is. # Based on http://code.activestate.com/recipes/146306/ class FormPostHandler(urllib.request.BaseHandler): From 3ec22ac552c948942d58abf3f927c4e8e8401489 Mon Sep 17 00:00:00 2001 From: Julien Langlois <16244608+julien-lang@users.noreply.github.com> Date: Wed, 15 Oct 2025 11:41:00 -0700 Subject: [PATCH 2/3] Update shotgun_api3/shotgun.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- shotgun_api3/shotgun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index 5b782420..d5ed44f5 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -4502,7 +4502,7 @@ def _send_form(self, url, params): return result else: - raise ShotgunError("Max attemps limit reached.") + raise ShotgunError("Max attempts limit reached.") # Helpers from the previous API, left as is. From 5016a828a0b662bc8dd43a7a024101c84750d184 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Thu, 16 Oct 2025 10:26:08 -0700 Subject: [PATCH 3/3] fixup! Update shotgun_api3/shotgun.py --- shotgun_api3/shotgun.py | 2 +- tests/test_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index d5ed44f5..6400ff37 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -4382,7 +4382,7 @@ def _upload_data_to_storage(self, data, content_type, size, storage_url): else: break else: - raise ShotgunError("Max attemps limit reached.") + raise ShotgunError("Max attempts limit reached.") etag = result.info()["Etag"] LOG.debug("Part upload completed successfully.") diff --git a/tests/test_client.py b/tests/test_client.py index 1e41ea91..a43e3ed4 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -523,7 +523,7 @@ def test_upload_s3_urlerror__get_attachment_upload_info(self): # Test the exception message the_exception = cm.exception - self.assertEqual(str(the_exception), "Max attemps limit reached.") + self.assertEqual(str(the_exception), "Max attempts limit reached.") def test_upload_s3_urlerror__upload_to_storage(self): """ @@ -557,7 +557,7 @@ def test_upload_s3_urlerror__upload_to_storage(self): # Test the exception message the_exception = cm.exception - self.assertEqual(str(the_exception), "Max attemps limit reached.") + self.assertEqual(str(the_exception), "Max attempts limit reached.") def test_transform_data(self): """Outbound data is transformed"""