8000 Session argument for aiohttp request object is ignored · Issue #700 · googleapis/google-auth-library-python · GitHub
[go: up one dir, main page]

Skip to content
Session argument for aiohttp request object is ignored #700
@greshilov

Description

@greshilov

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.

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

No one assigned

    Labels

    priority: p2Moderately-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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0