Skip to content

Commit 96fe521

Browse files
committed
Remove weakref usage and revert memory test threshold
Remove weakref.proxy usage in RequestSigner. The weakref was added for Python 2.6 memory leak prevention and is no longer needed. Also revert MAX_GROWTH_BYTES from 13MB back to 10MB in test_resource_leaks.py now that Python 3.14 support is official.
1 parent f5813ef commit 96fe521

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

botocore/signers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import base64
1414
import datetime
1515
import json
16-
import weakref
1716

1817
import botocore
1918
import botocore.auth
@@ -85,8 +84,7 @@ def __init__(
8584
self._auth_token = auth_token
8685
self._service_id = service_id
8786

88-
# We need weakref to prevent leaking memory in Python 2.6 on Linux 2.6
89-
self._event_emitter = weakref.proxy(event_emitter)
87+
self._event_emitter = event_emitter
9088

9189
@property
9290
def region_name(self):

tests/functional/leak/test_resource_leaks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class TestDoesNotLeakMemory(BaseClientDriverTest):
2222
# a substantial amount of time to the total test run time.
2323
INJECT_DUMMY_CREDS = True
2424
# We're making up numbers here, but let's say arbitrarily
25-
# that the memory can't increase by more than 13MB.
25+
# that the memory can't increase by more than 10MB.
2626

2727
# TODO: Attempt to bring this back to 10MB once Python 3.14 releases
28-
MAX_GROWTH_BYTES = 13 * 1024 * 1024
28+
MAX_GROWTH_BYTES = 10 * 1024 * 1024
2929

3030
def test_create_single_client_memory_constant(self):
3131
self.cmd('create_client', 's3')

0 commit comments

Comments
 (0)