noirbizarre / flask-restplus

Fully featured framework for fast, easy and documented API development with Flask
http://flask-restplus.readthedocs.org
Other
2.73k stars 507 forks source link

TypeError: __init__() got an unexpected keyword argument 'encoding #684

Open savithakj opened 5 years ago

savithakj commented 5 years ago
127.0.0.1 - - [14/Aug/2019 18:26:06] "GET /1.0/swagger.json HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 577, in error_router
    return original_handler(e)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 577, in error_router
    return original_handler(e)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 323, in wrapper
    return self.make_response(data, code, headers=headers)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 344, in make_response
    resp = self.representations[mediatype](data, *args, **kwargs)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/representations.py", line 25, in output_json
    dumped = dumps(data, **settings) + "\n"
  File "/home/user/sjayasankar/custom/python-3.7.2/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
TypeError: __init__() got an unexpected keyword argument 'encoding'
j5awry commented 5 years ago

Could you provide code related to this issues? What actions can we take to reproduce this issue and help troubleshoot?

savithakj commented 5 years ago

From redirect(url_for('api.doc'), 302)

The stacktrace is as follows :

127.0.0.1 - - [16/Aug/2019 13:28:42] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [16/Aug/2019 13:28:42] "GET /1.0/ HTTP/1.1" 200 -
127.0.0.1 - - [16/Aug/2019 13:28:43] "GET /swaggerui/droid-sans.css HTTP/1.1" 200 -
127.0.0.1 - - [16/Aug/2019 13:28:43] "GET /swaggerui/swagger-ui-bundle.js HTTP/1.1" 200 -
127.0.0.1 - - [16/Aug/2019 13:28:43] "GET /swaggerui/swagger-ui-standalone-preset.js HTTP/1.1" 200 -
127.0.0.1 - - [16/Aug/2019 13:28:43] "GET /swaggerui/swagger-ui.css HTTP/1.1" 200 -
[2019-08-16 13:28:44,528] ERROR in app: Exception on /1.0/swagger.json [GET]
Traceback (most recent call last):
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 323, in wrapper
    return self.make_response(data, code, headers=headers)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 344, in make_response
    resp = self.representations[mediatype](data, *args, **kwargs)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/representations.py", line 25, in output_json
    dumped = dumps(data, **settings) + "\n"
  File "/home/user/sjayasankar/custom/python-3.7.2/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
TypeError: __init__() got an unexpected keyword argument 'encoding'
[2019-08-16 13:28:44,531] ERROR in app: Exception on /1.0/swagger.json [GET]
Traceback (most recent call last):
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 577, in error_router
    return original_handler(e)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 323, in wrapper
    return self.make_response(data, code, headers=headers)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 344, in make_response
    resp = self.representations[mediatype](data, *args, **kwargs)
  File "/home/user/sjayasankar/code/sag_api/venv/lib/python3.7/site-packages/flask_restplus/representations.py", line 25, in output_json
    dumped = dumps(data, **settings) + "\n"
  File "/home/user/sjayasankar/custom/python-3.7.2/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
TypeError: __init__() got an unexpected keyword argument 'encoding'
 127.0.0.1 - - [16/Aug/2019 13:28:44] "GET /1.0/swagger.json HTTP/1.1" 500  -