buckket / twtxt

Decentralised, minimalist microblogging service for hackers.
http://twtxt.readthedocs.org/en/stable/
MIT License
1.94k stars 79 forks source link

TypeError: function() argument 'code' must be code, not str #162

Closed dertuxmalwieder closed 2 years ago

dertuxmalwieder commented 3 years ago

Situation:

# pip install twtxt
$ twtxt quickstart
Traceback (most recent call last):
  File "/usr/local/bin/twtxt", line 5, in <module>
    from twtxt.cli import main
  File "/usr/local/lib/python3.8/site-packages/twtxt/cli.py", line 29, in <module>
    from twtxt.twhttp import get_remote_tweets, get_remote_status
  File "/usr/local/lib/python3.8/site-packages/twtxt/twhttp.py", line 17, in <module>
    import aiohttp
  File "/usr/local/lib/python3.8/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 12, in <module>
    from . import hdrs, helpers
  File "/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py", line 742, in <module>
    class CeilTimeout(Timeout):
TypeError: function() argument 'code' must be code, not str

Environment:

$ uname -sr
OpenBSD 7.0

$ which python3
/usr/local/bin/python3

$ python3 -V
Python 3.8.12

Why?

la-ninpre commented 2 years ago

same here on arch linux.

$ uname -sr
Linux 5.15.2-zen1-1-zen

$ which python
/usr/bin/python

$ /usr/bin/python -V
Python 3.9.7
stxh commented 2 years ago

1, Modify setup.py line 32 'aiohttp>=2.2.5,<3', to 'aiohttp>=2.2.5,<4', 2, pip install --upgrade aiohttp

Obspogon commented 2 years ago
λ twtxt quickstart
Traceback (most recent call last):
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\Scripts\twtxt.exe\__main__.py", line 4, in <module>
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\site-packages\twtxt\cli.py", line 29, in <module>
    from twtxt.twhttp import get_remote_tweets, get_remote_status
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\site-packages\twtxt\twhttp.py", line 17, in <module>
    import aiohttp
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 15, in <module>
    from . import connector as connector_mod
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 12, in <module>
    from . import hdrs, helpers
  File "C:\Users\alico\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\helpers.py", line 742, in <module>
    class CeilTimeout(Timeout):
TypeError: function() argument 'code' must be code, not str

Error I got on Windows 10

ioalex commented 2 years ago

Also getting the same error as @dertuxmalwieder:

# pip install --user twtxt
$ twtxt quickstart
Traceback (most recent call last):
  File "/home/alex/.local/bin/twtxt", line 5, in <module>
    from twtxt.cli import main
  File "/home/alex/.local/lib/python3.10/site-packages/twtxt/cli.py", line 29, in <module>
    from twtxt.twhttp import get_remote_tweets, get_remote_status
  File "/home/alex/.local/lib/python3.10/site-packages/twtxt/twhttp.py", line 17, in <module>
    import aiohttp
  File "/home/alex/.local/lib/python3.10/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/home/alex/.local/lib/python3.10/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/home/alex/.local/lib/python3.10/site-packages/aiohttp/connector.py", line 12, in <module>
    from . import hdrs, helpers
  File "/home/alex/.local/lib/python3.10/site-packages/aiohttp/helpers.py", line 742, in <module>
    class CeilTimeout(Timeout):
TypeError: function() argument 'code' must be code, not str

Environment:

$ uname -sr
Linux 5.17.1-arch1-1

$ which python3
/usr/sbin/python3

$ python3 -V
Python 3.10.4
lambda2501 commented 2 years ago

Same error !

Traceback (most recent call last):
  File "/home/truc/.local/bin/twtxt", line 5, in <module>
    from twtxt.cli import main
  File "/home/truc/.local/lib/python3.10/site-packages/twtxt/cli.py", line 29, in <module>
    from twtxt.twhttp import get_remote_tweets, get_remote_status
  File "/home/truc/.local/lib/python3.10/site-packages/twtxt/twhttp.py", line 17, in <module>
    import aiohttp
  File "/home/truc/.local/lib/python3.10/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/home/truc/.local/lib/python3.10/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/home/truc/.local/lib/python3.10/site-packages/aiohttp/connector.py", line 12, in <module>
    from . import hdrs, helpers
  File "/home/truc/.local/lib/python3.10/site-packages/aiohttp/helpers.py", line 742, in <module>
    class CeilTimeout(Timeout):
TypeError: function() argument 'code' must be code, not str

Environment:

Linux 5.15.36_1
/bin/python3
Python 3.10.4
Ferryistaken commented 2 years ago

Same on Fedora 36

Traceback (most recent call last):
  File "/home/ferry/.local/bin//twtxt", line 5, in <module>
    from twtxt.cli import main
  File "/home/ferry/.local/lib/python3.10/site-packages/twtxt/cli.py", line 29, in <module>
    from twtxt.twhttp import get_remote_tweets, get_remote_status
  File "/home/ferry/.local/lib/python3.10/site-packages/twtxt/twhttp.py", line 17, in <module>
    import aiohttp
  File "/home/ferry/.local/lib/python3.10/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/home/ferry/.local/lib/python3.10/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/home/ferry/.local/lib/python3.10/site-packages/aiohttp/connector.py", line 12, in <module>
    from . import hdrs, helpers
  File "/home/ferry/.local/lib/python3.10/site-packages/aiohttp/helpers.py", line 742, in <module>
    class CeilTimeout(Timeout):
TypeError: function() argument 'code' must be code, not str

Environment:

Linux 5.19.9-200.fc36.x86_64 
Python 3.10.6