On Mon, 26 Dec 2016 15:44:22 +0900
IWASE Yusuke <[email protected]> wrote:

> With WebOB 1.7.0+, "charset" can not be omitted when constructing
> Request/Response instance and exception will occur if omitted.
> Example of Error occured on Travis-CI.
>   Traceback (most recent call last):
>   ...(snip)
>     File "/home/travis/build/iwaseyusuke/ryu/ryu/app/ofctl_rest.py", line 
> 220, in wrapper
>       body=json.dumps(ret))
>     File 
> "/home/travis/build/iwaseyusuke/ryu/.tox/py34/lib/python3.4/site-packages/webob/response.py",
>  line 310, in __init__
>       "You cannot set the body to a text value without a "
>   nose.proxy.TypeError: You cannot set the body to a text value without a 
> charset
>   ...(snip)
> 
> This patch adds wrapper classes of Request/Response for setting
> charset="UTF-8" by default and fixes REST Apps to use this classes,
> and fixes this problem.
> 
> IWASE Yusuke (2):
>   wsgi: Wrapper classes of Request/Response in WebOb
>   ryu/app: Use Request/Response wrappers in REST Apps
> 
>  ryu/app/ofctl_rest.py                 |  7 +++----
>  ryu/app/rest_conf_switch.py           |  6 +++---
>  ryu/app/rest_firewall.py              |  3 +--
>  ryu/app/rest_qos.py                   |  7 ++++---
>  ryu/app/rest_router.py                |  2 +-
>  ryu/app/rest_topology.py              |  6 ++++--
>  ryu/app/simple_switch_rest_13.py      |  6 ++++--
>  ryu/app/simple_switch_websocket_13.py | 11 +++++------
>  ryu/app/wsgi.py                       | 30 +++++++++++++++++++++++++++++-
>  ryu/tests/unit/app/test_ofctl_rest.py | 12 ++++++------
>  ryu/tests/unit/app/test_wsgi.py       |  2 +-
>  11 files changed, 61 insertions(+), 31 deletions(-)

Great, thanks!

I guess that at some point, we had better to fix all the usages of
Request/Response rather than this kinda workaround.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to