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

BaseDownloader.fetch passes coroutine to asyncio.wait which is forbidden in python 3.11 #4107

Closed
EamonTracey opened this issue Jul 20, 2023 · 1 comment · Fixed by #4130
Closed
Assignees
Labels

Comments

@EamonTracey
Copy link
Contributor

Python 3.8 deprecated passing coroutines to asyncio.wait and Python 3.11 will now raise an error. This causes the BaseDownloader.fetch call to fail on Python 3.11

done, _ = asyncio.get_event_loop().run_until_complete(asyncio.wait([self.run()]))
.

Python provides the solution in the error message: "Passing coroutines is forbidden, use tasks explicitly."

I believe this can be fixed by explicitly converting the coroutine to a task using asyncio's create_task

@mdellweg
Copy link
Member

Honestly why is it wrapped inside asyncio.wait anyway?
Also please read the python docs carefully about when things got added. There was confusion about the availability of create_task vs. ensure_future depending on the python version before.
We need to maintain at least python 3.8 compatibility.

EamonTracey added a commit to EamonTracey/pulpcore that referenced this issue Jul 24, 2023
fixes pulp#4107

Signed-off-by: EamonTracey <etracey@redhat.com>
EamonTracey added a commit to EamonTracey/pulpcore that referenced this issue Jul 25, 2023
EamonTracey added a commit to EamonTracey/pulpcore that referenced this issue Jul 25, 2023
EamonTracey added a commit to EamonTracey/pulpcore that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
patchback bot pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
dkliban pushed a commit that referenced this issue Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants