tilgovi / pyramid-oauthlib

Pyramid OAuthLib integration
BSD 2-Clause "Simplified" License
31 stars 16 forks source link

Python 3 / waitress 0.8.10 issues #9

Closed Doomas closed 9 years ago

Doomas commented 9 years ago

I ran into some Python 3 compatibility issues. This fix should be also compatible with Python 2.7+

Waitress 0.8.10 excepts strings instead of bytes.

tilgovi commented 9 years ago

I think you're right that this should change, but I think latin-1 is the encoding that we should be passing, maybe.

There is a bug, but I think we want native_(value, 'latin-1') instead. This is what WebOb does internally, because that's what WSGI servers expect.

https://github.com/Pylons/webob/pull/150

tilgovi commented 9 years ago

With text_ we get unicode type on Py2. With native_ we get str on both, which fits PEP3333's language about unicode and what WebOb seems to have discovered is best for compatibility with servers.

Doomas commented 9 years ago

Yes, you're right, native_ with latin-1 is the correct choice.

tilgovi commented 9 years ago

If you could make that change, squash the commits, and force push that up to this branch I can merge this with that change. That would be excellent. Thank you!

tilgovi commented 9 years ago

GitHub doesn't notify me when you push commits on a PR, only when you comment. But I noticed you made the change. Thanks.

If you wouldn't mind squashing the commits, that would be beautiful and then I'll hit merge.

Doomas commented 9 years ago

Sorry, my bad. Here you go.

tilgovi commented 9 years ago

Thanks so much!