ArchiveTeam / ArchiveBot

ArchiveBot, an IRC bot for archiving websites
http://www.archiveteam.org/index.php?title=ArchiveBot
MIT License
357 stars 72 forks source link

Abort causes "NameError: name 'open' is not defined" on some pipelines #427

Open JustAnotherArchivist opened 4 years ago

JustAnotherArchivist commented 4 years ago

Recently, on some pipelines, aborting a job started throwing logging exceptions at the end of NameError: name 'open' is not defined. This exception is raised in the logging's __init__.py inside FileHandler._open. It calls the core Python function open which should never be undefined.

Speculation: I suspect it has something to do with threads and code still running after the main wpull thread has already terminated, causing code to be unloaded. And presumably it's related to either the Python version or how Python is installed on those pipelines. Although I haven't investigated in detail, this appears to happen only on Buster-based pipelines. Buster ships with Python 3.7, which wpull doesn't support yet, so I installed Python 3.6 through pyenv on those machines instead.

Example from just a few minutes ago: 4w2xo5ti1en0cf332n067uoag