-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
Connexion throws error: AttributeError: module 'typing' has no attribute 'GenericMeta' while using python 3.7.0 #739
Comments
Can you post the entire exception? |
Hi @jmcs , here's a complete Trace: Looks somewhat related to sphinx-doc/sphinx#4490 I think I can get away with editing I also think it is a swagger-code-gen issue, if it is a connexion issue, I could try a PR if you guide me through it.
Thanks a lot for the the lib. :) |
Ok, if anyone have the same problem, you can edit util.py in the following way: Change
In
I used some google-fu and found this answer in stack overflow |
@willianscfa Is that change backward compatible with python 2.7 / 3.5 / 3.6? |
Unfortunately not @dtka. In python < 3.7 it worked just fine using This is a breaking change within the typing module itself. However, the commit associated with the sphinx issue linked above uses a backward compatible solution. They specifically check for the python version before accessing some properties. See tk0miya/sphinx@e2389b4. Anyway, |
ok awesome. I'll close the issue against connexion for now then. |
…ute 'GenericMeta' Ref: spec-first/connexion#739
By using this modification I have problem with python 3.6.5 in deserializing subobjects.
|
Description
While using python 3.7.0 with Swagger 2.0 server side python-flask code, we are getting the error "AttributeError: module 'typing' has no attribute 'GenericMeta'"
See line number 12
---Code---
1 def add_procedure(ProcedureItem=None): # noqa: E501
2 """adds an Procedure item
3
4 Adds an item to the system # noqa: E501
5
6 :param ProcedureItem: Procedure item to add
7 :type ProcedureItem: dict | bytes
8
9 :rtype: None
10 """
11 if connexion.request.is_json:
12 ProcedureItem = proc_item.from_dict(connexion.request.get_json()) # noqa: E501 -> Error here
13 return 'do some magic!'
Expected behaviour
Has to process the request and return " do some magic!"
Actual behaviour
throwing error at line 12
"AttributeError: module 'typing' has no attribute 'GenericMeta'"
Steps to reproduce
Download swagger python flask server side code and run with python 3.7
Additional info:
We ran the same file with python 3.6.7 and it worked as expected and returned, "do some magic!"
Output of the commands:
Just read the README document while downloading from swagger
The text was updated successfully, but these errors were encountered: