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

[BUG][Python][Python-Aiohttp] util._deserialize throws AttributeError in Python 3.7 #2022

Closed
bejohu opened this issue Jan 30, 2019 · 2 comments

Comments

@bejohu
Copy link

bejohu commented Jan 30, 2019

Description
Traceback (most recent call last):
  File "*******/venv/lib64/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "*******/venv/lib64/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "*******/venv/lib64/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "*******/venv/lib64/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "*******/venv/lib64/python3.7/site-packages/connexion/apis/aiohttp_api.py", line 32, in oauth_problem_middleware
    response = yield from handler(request)
  File "*******/venv/lib64/python3.7/site-packages/connexion/decorators/coroutine_wrappers.py", line 23, in wrapper
    connexion_response = yield from connexion_response
  File "*******/venv/lib64/python3.7/site-packages/connexion/apis/aiohttp_api.py", line 198, in get_response
    response = yield from response
  File "*******/openapi_server/controllers/search_controller.py", line 22, in search
    search_results = SearchResults.from_dict(data)
  File "*******/openapi_server/models/search_results.py", line 56, in from_dict
    return util.deserialize_model(dikt, cls)
  File "*******/openapi_server/util.py", line 106, in deserialize_model
    setattr(instance, attr, _deserialize(value, attr_type))
  File "*******/openapi_server/util.py", line 29, in _deserialize
    elif type(klass) == typing.GenericMeta:
AttributeError: module 'typing' has no attribute 'GenericMeta'
openapi-generator version

4.0.0-SNAPSHOT

Suggested fix

In _deserialize in util.mustache use typing_inspect, package which might get included in typing anyway.

@GuillaumeSmaha
Copy link
Contributor

Hi @bejohu,
Do you plan to create a PR for your commit bejohu@086580e ?

@wing328
Copy link
Member

wing328 commented May 30, 2019

Closed with #2884

@bejohu please pull the latest master to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants