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

batou is currently not compatible with Python 3.9 #93

Closed
jugmac00 opened this issue Sep 29, 2020 · 1 comment · Fixed by #108
Closed

batou is currently not compatible with Python 3.9 #93

jugmac00 opened this issue Sep 29, 2020 · 1 comment · Fixed by #108
Milestone

Comments

@jugmac00
Copy link
Contributor

❯ ./batou deploy staging -P
Creating venv ...
Ensuring pip ...
Installing batou ...
batou/2.0 (cpython 3.9.0-candidate1, Linux 4.15.0-1096-oem x86_64)
===================================================================== Preparing =====================================================================
main: Loading environment `staging`...
main: Verifying repository ...
You are using rsync. This is a non-verifying repository -- continuing on your own risk!
main: Loading secrets ...
================================================================== Connecting ... ===================================================================
xxx.fcio.net: Connecting via ssh (1/4)
xxx.fcio.net: Connecting via ssh (2/4)
xxx.fcio.net: Connecting via ssh (3/4)
xxx.fcio.net: Connecting via ssh (4/4)
=============================================================== Configuring model ... ===============================================================
======================================================= Waiting for remaining connections ... =======================================================
=========================================================== Predicting deployment actions ===========================================================
ERROR: Unexpected exception
      Traceback (most recent call last):
        File "/home/jugmac00/Projects/bliss_deployment/.batou/a33c4220/lib/python3.9/site-packages/batou/deploy.py", line 200, in main
          deployment.deploy()
        File "/home/jugmac00/Projects/bliss_deployment/.batou/a33c4220/lib/python3.9/site-packages/batou/deploy.py", line 171, in deploy
          pending = asyncio.Task.all_tasks()
      AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks'
      
=========================================================== DEPLOYMENT PREDICTION FAILED ============================================================

From cpython source code

* The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks`
  have been removed. They were deprecated since Python 3.7 and you can use
  :func:`asyncio.current_task` and :func:`asyncio.all_tasks` instead.
  (Contributed by Rémi Lapeyre in :issue:`40967`)

My idea would be to use a switch and use either asyncio.Task.all_tasks or asyncio.all_tasks depending on the Python version.

PR will follow later this afternoon.

@zagy
Copy link
Member

zagy commented Nov 3, 2020

This is actually broken with

  RuntimeError: no running event loop

@zagy zagy reopened this Nov 3, 2020
zagy added a commit that referenced this issue Nov 3, 2020
@ctheune ctheune added this to the batou 2.2 milestone Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants