What's New in WebOb 1.8¶
Feature¶
- Request.POSTnow supports any requests with the appropriate Content-Type. Allowing any HTTP method to access form encoded content, including DELETE, PUT, and others. See https://github.com/Pylons/webob/pull/352
Compatibility¶
- WebOb is no longer officially supported on Python 3.3 which was EOL'ed on 2017-09-29. - Please pin to WebOb~=1.7 which was tested against Python 3.3, and upgrade your Python version. 
Backwards Incompatibilities¶
- Many changes have been made to the way WebOb does Accept handling, not just for the - Acceptheader itself, but also for- Accept-Charset,- Accept-Encodingand- Accept-Language. This was a Google Summer of Code project completed by Whiteroses (https://github.com/whiteroses). Many thanks to Google for running GSoC, the Python Software Foundation for organising and a huge thanks to Ira for completing the work. See https://github.com/Pylons/webob/pull/338 and https://github.com/Pylons/webob/pull/335.- If you were previously using the - Acceptclass or the- MIMEAcceptclass directly, please take a look at the documentation for- create_accept_header(),- create_accept_charset_header(),- create_accept_encoding_header()and- create_accept_language_header().- These functions will accept a header value and create the appropriate object. - The API documentation for Accept* provides more information on the available API. 
- When calling a - @wsgifydecorated function, the default arguments passed to- @wsgifyare now used when called with the request, and not as a start_response- def hello(req, name): return "Hello, %s!" % name app = wsgify(hello, args=("Fred",)) req = Request.blank('/') resp = req.get_response(app) # => "Hello, Fred" resp2 = app(req) # => "Hello, Fred" - Previously the - resp2line would have failed with a- TypeError. With this change there is no way to override the default arguments with no arguments. See https://github.com/Pylons/webob/pull/203
- When setting - app_iteron a- Responseobject the- content_md5header is no longer cleared. This behaviour is odd and disallows setting the- content_md5and then returning an iterator for chunked content encoded responses. See https://github.com/Pylons/webob/issues/86
Experimental Features¶
These features are experimental and may change at any point in the future. The main page provides a list of Experimental API supported by WebOb.
- The cookie APIs now have the ability to set the SameSite attribute on a cookie in both - webob.cookies.make_cookie()and- webob.cookies.CookieProfile. See https://github.com/Pylons/webob/pull/255
Bugfix¶
- Request.host_url,- Request.host_port,- Request.domaincorrectly parse IPv6 Host headers as provided by a browser. See https://github.com/Pylons/webob/pull/332
- Request.authorizationwould raise- ValueErrorfor unusual or malformed header values. Now it simply returns an empty value. See https://github.com/Pylons/webob/issues/231
- Allow unnamed fields in form data to be properly transcoded when calling - request.decodewith an alternate encoding. See https://github.com/Pylons/webob/pull/309
- Response.__init__would discard- app_iterwhen a- Responsehad no body, this would cause issues when- app_iterwas an object that was tied to the life-cycle of a web application and had to be properly closed.- app_iteris more advanced API for- Responseand thus even if it contains a body and is thus against the HTTP RFC's, we should let the users shoot themselves in the foot by returning a body. See https://github.com/Pylons/webob/issues/305