Page MenuHomePhabricator

RuntimeError: cannot join current thread after updating to new version/python3
Closed, ResolvedPublic


Pywikibot was downloaded on 20200918 from link at

python version: Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux

The problem happens with larger wiki-files (upload), which did not cause trouble with earlier version/python2

Error output:

WARNING: Waiting 40.0 seconds before retrying.
Exception in thread Put-Thread:
Traceback (most recent call last):
  File "/usr/lib/python3.6/", line 916, in _bootstrap_inner
  File "/usr/lib/python3.6/", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/mbuch/core_stable/pywikibot/", line 1386, in async_manager
    request(*args, **kwargs)
  File "/home/mbuch/core_stable/pywikibot/page/", line 99, in handle
    func(self, *args, **kwargs)
  File "/home/mbuch/core_stable/pywikibot/page/", line 1315, in _save
    watch=watch, bot=botflag, **kwargs)
  File "/home/mbuch/core_stable/pywikibot/site/", line 94, in callee
    return fn(self, *args, **kwargs)
  File "/home/mbuch/core_stable/pywikibot/site/", line 5202, in editpage
    result = req.submit()
  File "/home/mbuch/core_stable/pywikibot/data/", line 1969, in submit
  File "/home/mbuch/core_stable/pywikibot/data/", line 1729, in _http_request
  File "/home/mbuch/core_stable/pywikibot/data/", line 2097, in wait
  File "/home/mbuch/core_stable/pywikibot/", line 1310, in sleep
  File "/home/mbuch/core_stable/pywikibot/", line 1323, in stopme
  File "/home/mbuch/core_stable/pywikibot/", line 1361, in _flush
  File "/usr/lib/python3.6/", line 1053, in join
    raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread

Event Timeline

It happens when the upload link is too slow and the write operation runs into timeout.

It claims to have terminayes successfully:

1 pages read
1 pages written
0 pages skipped
Execution time: 112 seconds
Read operation time: 8.0 seconds
Write operation time: 112.0 seconds
Script terminated successfully.

But no files have been changed.

The same operation works when done over my phone AP (LTE)

Xqt triaged this task as Medium priority.Sep 20 2020, 10:29 AM
Xqt added subscribers: valhallasw, Xqt.

I guess this is pywikibot stable release.

Change 628580 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Check whether _putthead is not current_thread() to join()

Change 628580 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Check whether _putthead is current_thread() to join()