s3transfer icon indicating copy to clipboard operation
s3transfer copied to clipboard

Fix Argument order in TransferManager shutdown method

Open nl-sm opened this issue 11 months ago • 0 comments

Calling shutdown from a TransferManager object throws an error further down the line, since the argument order passed to _shutdown is incorrect. Calling the function results in an exception being thrown like below

 File "/repos/test/app/clients/aws/s3.py", line 42, in shutdown_transfer 
   self.transfer_manager.shutdown(cancel=True)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/repos/test/.venv/lib/python3.13/site-packages/s3transfer/manager.py", line 626, in shutdown
    self._shutdown(cancel, cancel, cancel_msg)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/repos/test/.venv/lib/python3.13/site-packages/s3transfer/manager.py", line 632, in _shutdown
    self._coordinator_controller.cancel(cancel_msg, exc_type)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/repos/test/.venv/lib/python3.13/site-packages/s3transfer/manager.py", line 707, in cancel
    transfer_coordinator.cancel(msg, exc_type)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/repos/test/.venv/lib/python3.13/site-packages/s3transfer/futures.py", line 277, in cancel
    self._exception = exc_type(msg)
                      ~~~~~~~~^^^^^
TypeError: 'str' object is not callable

nl-sm avatar Jan 24 '25 08:01 nl-sm