From: Harmon Date: Sat, 11 Feb 2023 00:10:20 +0000 (-0600) Subject: Handle incorrect processing state for errored chunked uploads X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a68ce8658ab0908227dc486e73d02060e21174f8;p=tweepy.git Handle incorrect processing state for errored chunked uploads --- diff --git a/tweepy/api.py b/tweepy/api.py index 5279c74..3d755c8 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -3684,7 +3684,11 @@ class API: media = self.chunked_upload_finalize(media_id, **kwargs) if wait_for_async_finalize and hasattr(media, 'processing_info'): - while media.processing_info['state'] in ('pending', 'in_progress'): + while ( + media.processing_info['state'] in ( + 'pending', 'in_progress' + ) and 'error' not in media.processing_info + ): time.sleep(media.processing_info['check_after_secs']) media = self.get_media_upload_status(media.media_id, **kwargs)