s3transfer icon indicating copy to clipboard operation
s3transfer copied to clipboard

Typo in `manager.TransferManager.shutdown()`.

Open rickarmstrong opened this issue 7 months ago • 0 comments

There's what appears to be a typo in manager.TransferManager.shutdown(): https://github.com/boto/s3transfer/blob/c87f32193809e6b7f178b8cf2747c91935dc8308/s3transfer/manager.py#L626

I think the intent was self._shutdown(cancel, cancel_msg). Calling shutdown(cancel=True) raises TypeError. The less-than-ideal workaround is to call TransferManager._shutdown() directly.

The trace:

Traceback (most recent call last):
(irrelevant stuff removed)
  File "/home/cedar/venv/cedar/lib/python3.12/site-packages/s3transfer/manager.py", line 626, in shutdown
    self._shutdown(cancel, cancel, cancel_msg)
  File "/home/cedar/venv/cedar/lib/python3.12/site-packages/s3transfer/manager.py", line 632, in _shutdown
    self._coordinator_controller.cancel(cancel_msg, exc_type)
  File "/home/cedar/venv/cedar/lib/python3.12/site-packages/s3transfer/manager.py", line 707, in cancel
    transfer_coordinator.cancel(msg, exc_type)
  File "/home/cedar/venv/cedar/lib/python3.12/site-packages/s3transfer/futures.py", line 279, in cancel
    self._exception = exc_type(msg)
                      ^^^^^^^^^^^^^
TypeError: 'str' object is not callable

rickarmstrong avatar Jul 23 '24 18:07 rickarmstrong