-
Notifications
You must be signed in to change notification settings - Fork 325
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: Linux
- Python version: 3.9
- pip version: 20.2.3
google-auth
version: 1.26.1
Steps to reproduce
Consider the following example:
import asyncio
import aiohttp
from google.auth.transport._aiohttp_requests import Request
async def main():
async with aiohttp.ClientSession() as session:
req = Request(session)
assert req.session == session
if __name__ == '__main__':
asyncio.run(main())
This code will raise AssertionError
, because the session argument is ignored in the Request
object.
google-auth-library-python/google/auth/transport/_aiohttp_requests.py
Lines 140 to 141 in aeab5d0
def __init__(self, session=None): | |
self.session = None |
This may also cause runtime warnings about unclosed sessions when AuthorizedSession
object is used.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.