TypeError: You cannot set the body to a text value without a charset (WebOb 1.6.3)

Bug #1653646 reported by Lucas Alvares Gomes on 2017-01-03
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
keystonemiddleware
High
Lucas Alvares Gomes

Bug Description

The WebOB "charset" can not be omitted when constructing Request/Response instance and exception will occur if omitted:

...

/py35/lib/python3.5/site-packages/keystonemiddleware/auth_token/__init__.py", line 654, in process_request'
2017-01-03 09:37:22.322567 | b" content_type='application/json; charset=UTF-8')"
2017-01-03 09:37:22.322603 | b' File "/home/jenkins/workspace/gate-ironic-python35-db/.tox/py35/lib/python3.5/site-packages/webob/exc.py", line 271, in __init__'
2017-01-03 09:37:22.322612 | b' **kw)'
2017-01-03 09:37:22.322647 | b' File "/home/jenkins/workspace/gate-ironic-python35-db/.tox/py35/lib/python3.5/site-packages/webob/response.py", line 139, in __init__'
2017-01-03 09:37:22.322666 | b' "You cannot set the body to a text value without a "'
2017-01-03 09:37:22.322687 | b'TypeError: You cannot set the body to a text value without a charset'

Full logs: http://logs.openstack.org/11/416111/1/check/gate-ironic-python35-db/161493a/console.html

Changed in keystonemiddleware:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)

Fix proposed to branch: master
Review: https://review.openstack.org/416198

Changed in keystonemiddleware:
status: New → In Progress
no longer affects: ironic

Change abandoned by Lucas Alvares Gomes (<email address hidden>) on branch: master
Review: https://review.openstack.org/416198
Reason: It works with WebOb 1.7.0 but fails for 1.6.3

summary: - ypeError: You cannot set the body to a text value without a charset
+ TypeError: You cannot set the body to a text value without a charset
Changed in keystonemiddleware:
status: In Progress → Invalid
assignee: Lucas Alvares Gomes (lucasagomes) → nobody
Changed in keystonemiddleware:
status: Invalid → New
summary: TypeError: You cannot set the body to a text value without a charset
+ (WebOb 1.6.3)
Changed in keystonemiddleware:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
status: New → In Progress
Steve Martinelli (stevemar) wrote :

Ignore comment in #3, I understand the issue fully now.

Reviewed: https://review.openstack.org/416198
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=2092d5783607223c7cbdfed690997e9c9f831b6f
Submitter: Jenkins
Branch: master

commit 2092d5783607223c7cbdfed690997e9c9f831b6f
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Jan 3 10:12:12 2017 +0000

    Auth token, set the correct charset

    Explicit set the charset to UTF-8 when replying with 401. It's now
    required by webob.

    A previous attempt to fix this problem was introduced as part of the
    commit 20fb1dbe5a884ecdbf6ee5ea26b2660f7a7e4b1e but this is only
    compatible with the version 1.7.0 of WebOb, older versions will break.
    See:
    http://logs.openstack.org/05/371605/12/check/gate-ironic-python35-db/686bd86/console.html#_2017-01-03_11_10_11_760197

    Change-Id: I30adc87882ce8bd2c18588161d5c60d77a56925e
    Closes-Bug: #1653646

Changed in keystonemiddleware:
status: In Progress → Fix Released
Changed in keystonemiddleware:
importance: Undecided → High

This issue was fixed in the openstack/keystonemiddleware 4.13.1 release.

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/418118

Change abandoned by Steve Martinelli (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/418117

Sylvain Benner (syl20bnr) wrote :

It is fixed for me with WebOb 1.6.3

But if I install 1.7.0 or above it fails with the same error.

This issue was fixed in the openstack/keystonemiddleware 4.9.1 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers