List of steps to reproduce (step by step, including full links if applicable):
- Attempt to copy-upload a file from the Internet Archive using Pywikibot:
site.upload(filepage, source_url=file_url, comment=desc)
- If the upload succeeds, the call still hangs:
File "./script.py", line 105, in upload self.site.upload(filepage, source_url=file_url, File "/usr/lib/python3.9/site-packages/pywikibot/tools/_deprecate.py", line 404, in wrapper return obj(*__args, **__kw) File "/usr/lib/python3.9/site-packages/pywikibot/site/_decorators.py", line 92, in callee return fn(self, *args, **kwargs) File "/usr/lib/python3.9/site-packages/pywikibot/site/_apisite.py", line 2869, in upload result = final_request.submit() File "/usr/lib/python3.9/site-packages/pywikibot/data/api.py", line 1757, in submit response, use_get = self._http_request(use_get, uri, body, headers, File "/usr/lib/python3.9/site-packages/pywikibot/data/api.py", line 1510, in _http_request self.wait() File "/usr/lib/python3.9/site-packages/pywikibot/data/api.py", line 1892, in wait pywikibot.sleep(delay) File "/usr/lib/python3.9/site-packages/pywikibot/__init__.py", line 1305, in sleep
It looks like the handler is catching the 504 which is often returned, and retrying, which for a large file can take an extremely long time. However, during a copy upload, a 504 is very common, but the file may still upload.
What should have happened instead?:
- Call either succeeds, or times out and allows the script to continue.
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc: