Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibilty with python 3.9+ #161

Closed
schtobia opened this issue Sep 30, 2021 · 3 comments · Fixed by #165
Closed

Incompatibilty with python 3.9+ #161

schtobia opened this issue Sep 30, 2021 · 3 comments · Fixed by #165
Labels
Milestone

Comments

@schtobia
Copy link

schtobia commented Sep 30, 2021

Python 3.9 removes Task.current_task(), which was deprecated since 3.7. AIOHTTP adopted these changes in 3.0.8. Therefore, at least 3.0.8 is necessary for working with newer versions of python - but twtxt doesn't work with this version:

$ twtxt -v view https://notiz.blog/author/matthias-pfefferle/feed/twtxt
2021-09-30 09:01:49,569 twtxt.cli    DEBUG    Not following https://notiz.blog/author/matthias-pfefferle/feed/twtxt, trying as URL
2021-09-30 09:01:49,570 asyncio      DEBUG    Using selector: EpollSelector
2021-09-30 09:01:49,572 asyncio      ERROR    Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7ff7777618e0>
  • Which version of twtxt are you using?

Tried both on master and v1.2.3.

  • Which version of Python are you using?

Python 3.9.5, as provided by Ubuntu hirsute.

  • On which platform are you running twtxt?

Ubuntu 21.04 hirsute

@buckket buckket added the bug label Oct 7, 2021
@buckket buckket added this to the 1.3.0 milestone Oct 7, 2021
@schtobia
Copy link
Author

Nope, still an error:

(venv) host projects/twtxt ‹master› » twtxt -v view https://notiz.blog/author/matthias-pfefferle/feed/twtxt
Traceback (most recent call last):
  File "/home/schtobia/projects/twtxt/venv/bin/twtxt", line 33, in <module>
    sys.exit(load_entry_point('twtxt', 'console_scripts', 'twtxt')())
  File "/home/schtobia/projects/twtxt/venv/bin/twtxt", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/schtobia/projects/twtxt/twtxt/cli.py", line 30, in <module>
    from twtxt.twhttp import get_remote_tweets, get_remote_status
  File "/home/schtobia/projects/twtxt/twtxt/twhttp.py", line 13, in <module>
    import nest_asyncio
ModuleNotFoundError: No module named 'nest_asyncio'

I'll open a PR for that.

@buckket
Copy link
Owner

buckket commented Nov 12, 2022

I forgot to remove the import statement. nest_asyncio is no longer needed.

master should now work for you. Can you confirm?

@schtobia
Copy link
Author

confirmed, the fix works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants