Comment 0 for bug 1372484

Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

[Caveat: I am not a py34 expert so I may be just wrong here ;) ]

I am trying to use auth_token middleware for a personal project, this project is a py34 only. So far at runtime things seems to work and auth_token works under py34 byt when trying to integrate this with webtest I am getting this error ;

AssertionError: Iterator <list_iterator object at 0x7f8605664128> returned a non-<class 'bytes'> object: 'Authentication required'

this come from webtest which explictely check if the error message come as bytes :

https://github.com/Pylons/webtest/blob/master/webtest/lint.py#L298-L300

it seems that the obvious fix is something like this (which should work on py2 as well) :

http://paste.openstack.org/raw/fMNhM0Sd9hw4q3uuN5gq/

Which seems right, I think but I am not totally sure, let me know what do you think before I submit it.