poljar / weechat-matrix

Weechat Matrix protocol script written in python
Other
963 stars 121 forks source link

AttributeError: module 'signal' has no attribute 'SIGABRT' #316

Closed dougluce closed 2 years ago

dougluce commented 2 years ago

On the first attempt of /script load matrix.py in a fresh weechat (3.2) session, I get this:

12:20 python: loading script "/tank/doug/.weechat/python/matrix.py"
12:20 =!= python: unable to call function "info_get", script is not initialized (script: -)
12:20 python: stdout/stderr (?): Traceback (most recent call last):
12:20 python: stdout/stderr (?):   File "/tank/doug/.weechat/python/matrix.py", line 53, in <module>
12:20 python: stdout/stderr (?):     from nio import RemoteProtocolError, RemoteTransportError, TransportType
12:20 python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/nio/__init__.py", line 2, in <module>
12:20 python: stdout/stderr (?):     from .client import *
12:20 python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/nio/client/__init__.py", line 6, in <module>
12:20 python: stdout/stderr (?):     from .async_client import AsyncClient, AsyncClientConfig, DataProvider
12:20 python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/nio/client/async_client.py", line 47, in <module>
12:20 python: stdout/stderr (?):     from aiohttp import (
12:20 python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/aiohttp/__init__.py", line 213, in <module>
12:20 python: stdout/stderr (?):     from .worker import GunicornUVLoopWebWorker, GunicornWebWorker
12:20 python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/aiohttp/worker.py", line 12, in <module>
12:20 python: stdout/stderr (?):     from gunicorn.workers import base
12:20 python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 29, in <module>
12:20 python: stdout/stderr (?):     class Worker(object):
12:20 python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 31, in Worker
12:20 python: stdout/stderr (?):     SIGNALS = [getattr(signal, "SIG%s" % x)
12:20 python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 31, in <listcomp>
12:20 python: stdout/stderr (?):     SIGNALS = [getattr(signal, "SIG%s" % x)
12:20 python: stdout/stderr (?): AttributeError: module 'signal' has no attribute 'SIGABRT'
12:20 =!= python: unable to parse file "/tank/doug/.weechat/python/matrix.py"

A second attempt in the same session gives me this:

121840     | python: loading script "/tank/doug/.weechat/python/matrix.py"
121841     | python: stdout/stderr (?): Traceback (most recent call last):
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/declarations.py", line 362, in implementedBy
121841     | python: stdout/stderr (?):     if isinstance(cls, super):
121841     | python: stdout/stderr (?): NameError: name 'isinstance' is not defined
121841     | python: stdout/stderr (?): During handling of the above exception, another exception occurred:
121841     | python: stdout/stderr (?): Traceback (most recent call last):
121841     | python: stdout/stderr (?):   File "/tank/doug/.weechat/python/matrix.py", line 41, in <module>
121841     | python: stdout/stderr (?):     import logbook
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/logbook/__init__.py", line 14, in <module>
121841     | python: stdout/stderr (?):     from .base import (
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/logbook/base.py", line 19, in <module>
121841     | python: stdout/stderr (?):     from logbook.concurrency import (greenlet_get_ident, thread_get_ident,
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/logbook/concurrency.py", line 4, in <module>
121841     | python: stdout/stderr (?):     import gevent
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/__init__.py", line 85, in <module>
121841     | python: stdout/stderr (?):     from gevent._config import config
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/_config.py", line 699, in <module>
121841     | python: stdout/stderr (?):     Loop().get()
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/_config.py", line 146, in get
121841     | python: stdout/stderr (?):     self.value = self.validate(self._default())
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/_config.py", line 248, in validate
121841     | python: stdout/stderr (?):     return self._import_one_of([self.shortname_map.get(x, x) for x in value])
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/_config.py", line 219, in _import_one_of
121841     | python: stdout/stderr (?):     return self._import_one(item)
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/_config.py", line 237, in _import_one
121841     | python: stdout/stderr (?):     module = importlib.import_module(module)
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
121841     | python: stdout/stderr (?):     return _bootstrap._gcd_import(name[level:], package, level)
121841     | python: stdout/stderr (?):   File "/home/doug/.local/lib/python3.8/site-packages/gevent/libev/corecffi.py", line 17, in <module>
121841     | python: stdout/stderr (?):     from zope.interface import implementer
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/__init__.py", line 57, in <module>
121841     | python: stdout/stderr (?):     _wire()
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/interface.py", line 1122, in _wire
121841     | python: stdout/stderr (?):     from zope.interface.interfaces import IElement
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/interfaces.py", line 1081, in <module>
121841     | python: stdout/stderr (?):     class ObjectEvent(object):
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/declarations.py", line 617, in __call__
121841     | python: stdout/stderr (?):     classImplements(ob, *self.interfaces)
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/declarations.py", line 494, in classImplements
121841     | python: stdout/stderr (?):     spec = implementedBy(cls)
121841     | python: stdout/stderr (?):   File "/usr/local/lib/python3.8/site-packages/zope/interface/declarations.py", line 368, in implementedBy
121841     | python: stdout/stderr (?):     except AttributeError:
121841     | python: stdout/stderr (?): NameError: name 'AttributeError' is not defined
121841 =!= | python: unable to parse file "/tank/doug/.weechat/python/matrix.py"

This is on a FreeBSD 13.0 machine, using weechat's Python 3.8.10 venv.

dougluce commented 2 years ago

While I don't know the actual cause of this error, a full removal and reinstallation of Python and all Python packages made this error to go away.