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

RequestInfo change to a named tuple broke BC #9866

Closed
1 task done
bartfeenstra opened this issue Nov 13, 2024 · 4 comments · Fixed by #9873
Closed
1 task done

RequestInfo change to a named tuple broke BC #9866

bartfeenstra opened this issue Nov 13, 2024 · 4 comments · Fixed by #9873
Labels

Comments

@bartfeenstra
Copy link

Describe the bug

Existing usage of aiohttp 3.10 no longer works with aiohttp 3.13, causing the following error: TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'

To Reproduce

Run the following code:

"""
Reproduce a regression in aiohttp 3.11.0.
"""

from multidict import CIMultiDict, CIMultiDictProxy

from aiohttp.client_reqrep import RequestInfo
from yarl import URL

RequestInfo(URL(), "GET", CIMultiDictProxy(CIMultiDict()))

With aiohttp 3.10.11, this exits without an error. With aiohttp 3.11.0, this raises TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'

Expected behavior

The expected behavior is for no error to be raised, by real_url not being a required argument.

Logs/tracebacks

.

Python Version

3.13

aiohttp Version

3.11.0

multidict Version

6.1.0

propcache Version

0.2.0

yarl Version

1.17.1

OS

Ubuntu 24.04

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@bdraco
Copy link
Member

bdraco commented Nov 13, 2024

This is expected. Its mentioned as breaking in the changelog
Screenshot 2024-11-13 at 1 46 17 PM

@bdraco bdraco closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
@d1manson
Copy link

fyi this is breaking for https://github.com/pnuckowski/aioresponses

@bdraco
Copy link
Member

bdraco commented Nov 13, 2024

Please see pnuckowski/aioresponses#262

potiuk added a commit to potiuk/airflow that referenced this issue Nov 13, 2024
Because of aio-libs/aiohttp#9866 some tests are failing. This PR can be
reverted when pnuckowski/aioresponses#262 is merged and released
potiuk added a commit to potiuk/airflow that referenced this issue Nov 14, 2024
Because of aio-libs/aiohttp#9866 some tests are failing. This PR can be
reverted when pnuckowski/aioresponses#262 is merged and released
potiuk added a commit to potiuk/airflow that referenced this issue Nov 14, 2024
Because of aio-libs/aiohttp#9866 some tests are failing. This PR can be
reverted when pnuckowski/aioresponses#262 is merged and released
potiuk added a commit to apache/airflow that referenced this issue Nov 14, 2024
Because of aio-libs/aiohttp#9866 some tests are failing. This PR can be
reverted when pnuckowski/aioresponses#262 is merged and released
amoghrajesh pushed a commit to astronomer/airflow that referenced this issue Nov 14, 2024
Because of aio-libs/aiohttp#9866 some tests are failing. This PR can be
reverted when pnuckowski/aioresponses#262 is merged and released
@bdraco bdraco reopened this Nov 14, 2024
bdraco added a commit that referenced this issue Nov 14, 2024
It was unexpected that this object was being created directly
outside of aiohttp internals. While it looks like its only
used for mocking downstream, we can accomodate that by subclassing
the NamedTuple and providing a `__new__` while keeping the faster
`tuple.__new__` internally.

fixes #9866
bdraco added a commit that referenced this issue Nov 14, 2024
It was unexpected that this object was being created directly
outside of aiohttp internals. While it looks like its only
used for mocking downstream, we can accomodate that by subclassing
the NamedTuple and providing a `__new__` while keeping the faster
`tuple.__new__` internally.

fixes #9866
@bdraco
Copy link
Member

bdraco commented Nov 14, 2024

My initial call on this was we didn't want to change it because we don't expect these objects to be created externally but since there is no great alternative to do the mocking, I opened #9873

bdraco pushed a commit that referenced this issue Nov 14, 2024
…rds compatible with 3.10 (#9874)

Co-authored-by: J. Nick Koston <nick@koston.org>
fixes #9866
kaxil added a commit to astronomer/airflow that referenced this issue Nov 14, 2024
bdraco pushed a commit that referenced this issue Nov 14, 2024
…rds compatible with 3.10 (#9886)

Co-authored-by: J. Nick Koston <nick@koston.org>
fixes #9866
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants