Upgrading Werkzeug 0.1 to 0.2
Breaking0.1 → 0.2Breaking3Deprecated1New18Changed6Fixed1Other1
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- The lazy_property helper is now called cached_property.
- Redirects now use a permanent 301 status and are treated as HTTP exceptions.
- Scripts using boolean arguments must use the new calling format.
- The reporter stream class is moving to the contrib module; update imports for 0.3.
Must act 4 items need code or config changes
What you must change
Breaking3
Renames lazy_property to cached_property.
lazy_propertycached_propertyMakes RequestRedirect a subclass of HTTPException and changes its status code from 302 to 301.
RequestRedirectHTTPExceptionChanges the caller format for boolean arguments in werkzeug.script.
werkzeug.scriptDeprecations to plan for
Deprecated1
Moves BaseReporterStream into the werkzeug contrib module, importable there from 0.3.
BaseReporterStreamAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
class module(ModuleType) - added:
variable attribute_modules
- added:
class AtomFeed(object) - added:
class FeedEntry(object) - added:
constructor AtomFeed(title=…, entries=…, **kwargs) - added:
constructor FeedEntry(title=…, content=…, **kwargs) - added:
field AtomFeed.default_generator - added:
function format_iso8601(obj) - added:
method AtomFeed.add(*args, **kwargs) - added:
method AtomFeed.generate() - added:
method AtomFeed.get_response() - added:
method AtomFeed.to_string() - added:
method FeedEntry.generate() - added:
method FeedEntry.to_string() - added:
variable XHTML_NAMESPACE
- added:
class BaseCache(object) - added:
class FileSystemCache(BaseCache) - added:
class MemcachedCache(BaseCache) - added:
class NullCache(BaseCache) - added:
class SimpleCache(BaseCache) - added:
constructor BaseCache(default_timeout=…) - added:
constructor FileSystemCache(cache_dir, threshold=…, default_timeout=…) - added:
constructor MemcachedCache(servers, default_timeout=…) - added:
constructor SimpleCache(threshold=…, default_timeout=…) - added:
field BaseCache.add - added:
field BaseCache.delete - added:
method BaseCache.clear() - added:
method BaseCache.delete_many(*keys) - added:
method BaseCache.get(key) - added:
method BaseCache.get_dict(*keys) - added:
method BaseCache.get_many(*keys) - added:
method BaseCache.set(key, value, timeout=…) - added:
method BaseCache.set_many(mapping, timeout=…) - added:
method FileSystemCache.add(key, value, timeout=…) - added:
method FileSystemCache.clear() - added:
method FileSystemCache.delete(key) - added:
method FileSystemCache.get(key) - added:
method FileSystemCache.set(key, value, timeout=…) - added:
method MemcachedCache.add(key, value, timeout=…) - added:
method MemcachedCache.clear() - added:
method MemcachedCache.delete(key) - added:
method MemcachedCache.delete_many(*keys) - added:
method MemcachedCache.get(key) - added:
method MemcachedCache.get_many(*keys) - added:
method MemcachedCache.set(key, value, timeout=…) - added:
method MemcachedCache.set_many(mapping, timeout=…) - added:
method SimpleCache.add(key, value, timeout=…) - added:
method SimpleCache.delete(key) - added:
method SimpleCache.get(key) - added:
method SimpleCache.set(key, value, timeout=…) - added:
variable have_memcache
- changed:
constructor Request(environ, url_map) → constructor Request(environ, url_map, session_store=…, cookie_name=…) - added:
class Application(object) - added:
class GenshiTemplateLoader(TemplateLoader) - added:
constructor Application(name, url_map, session=…, processors=…) - added:
constructor GenshiTemplateLoader(search_path, encoding=…, **kwargs) - added:
method Application.config_session(store, expiration=…) - added:
method GenshiTemplateLoader.get_template(template_name) - added:
method GenshiTemplateLoader.render_to_string(template_name, context=…)
- added:
class MergeStream(object) - added:
class ProfilerMiddleware(object) - added:
constructor MergeStream(*streams) - added:
constructor ProfilerMiddleware(app, stream=…, sort_by=…, restrictions=…) - added:
function make_action(app_factory, hostname=…, port=…, threaded=…, processes=…, stream=…, sort_by=…, restrictions=…) - added:
method MergeStream.write(data) - added:
variable available
- added:
class BaseReporterStream(object) - added:
constructor BaseReporterStream(environ, threshold) - added:
method BaseReporterStream.processed() - added:
method BaseReporterStream.read(size=…) - added:
method BaseReporterStream.readline(*args) - added:
method BaseReporterStream.readlines(hint=…)
- added:
class SecureCookie(ModificationTrackingDict) - added:
class UnquoteError(Exception) - added:
constructor SecureCookie(data=…, secret_key=…, new=…) - added:
field SecureCookie.hash_method - added:
field SecureCookie.load_cookie - added:
field SecureCookie.should_save - added:
field SecureCookie.unserialize - added:
function pickle_quote(value) - added:
function pickle_unquote(string) - added:
method SecureCookie.load_cookie(request, key=…, secret_key=…) - added:
method SecureCookie.new_salt(secret_key) - added:
method SecureCookie.save_cookie(response, key=…, expires=…, session_expires=…, max_age=…, path=…, domain=…, secure=…, httponly=…, force=…) - added:
method SecureCookie.serialize(expires=…) - added:
method SecureCookie.should_save() - added:
method SecureCookie.unserialize(string, secret_key)
- removed:
field Session.clear - removed:
field Session.pop - removed:
field Session.popitem - removed:
field Session.setdefault - removed:
field Session.update - removed:
method Session.call_with_modification() - removed:
method Session.copy() - changed:
class Session(dict) → class Session(ModificationTrackingDict) - changed:
constructor SessionMiddleware(app, store, cookie_name=…, cookie_age=…, cookie_path=…, cookie_domain=…, cookie_secure=…, environ_key=…) → constructor SessionMiddleware(app, store, cookie_name=…, cookie_age=…, cookie_expires=…, cookie_path=…, cookie_domain=…, cookie_secure=…, cookie_httponly=…, environ_key=…) - added:
class ModificationTrackingDict(dict) - added:
constructor ModificationTrackingDict(*args, **kwargs) - added:
field ModificationTrackingDict.clear - added:
field ModificationTrackingDict.pop - added:
field ModificationTrackingDict.popitem - added:
field ModificationTrackingDict.setdefault - added:
field ModificationTrackingDict.update - added:
function generate_key(salt=…) - added:
method ModificationTrackingDict.call_with_modification() - added:
method ModificationTrackingDict.copy()
- added:
class ContentAccessors(object) - added:
class TestResponse(Response, ContentAccessors) - added:
field ContentAccessors.json - added:
field ContentAccessors.lxml - added:
field ContentAccessors.xml - added:
method ContentAccessors.json() - added:
method ContentAccessors.lxml() - added:
method ContentAccessors.xml()
- added:
class Aborter(object) - added:
class NotAcceptable(HTTPException) - added:
constructor Aborter(mapping=…, extra=…) - added:
constructor HTTPException(description=…) - added:
constructor MethodNotAllowed(valid_methods=…, description=…) - added:
field NotAcceptable.code - added:
field NotAcceptable.description - added:
method HTTPException.get_response(environ) - added:
method MethodNotAllowed.get_headers(environ) - added:
variable abort - added:
variable default_exceptions
- changed:
function parse_cache_control_header(value) → function parse_cache_control_header(value, on_update=…) - added:
class ETags(object) - added:
class HeaderSet(object) - added:
constructor ETags(strong_etags=…, weak_etags=…, star_tag=…) - added:
constructor HeaderSet(headers=…, on_update=…) - added:
function generate_etag(data) - added:
function is_resource_modified(environ, etag=…, data=…, last_modified=…) - added:
function parse_date(value) - added:
function parse_etags(value) - added:
function parse_set_header(value, on_update=…) - added:
function quote_etag(etag, weak=…) - added:
function unquote_etag(etag) - added:
method ETags.as_set(include_weak=…) - added:
method ETags.contains(etag) - added:
method ETags.contains_raw(etag) - added:
method ETags.contains_weak(etag) - added:
method ETags.is_weak(etag) - added:
method ETags.to_header() - added:
method HeaderSet.add(header) - added:
method HeaderSet.as_set(preserve_casing=…) - added:
method HeaderSet.clear() - added:
method HeaderSet.discard(header) - added:
method HeaderSet.find(header) - added:
method HeaderSet.index(header) - added:
method HeaderSet.remove(header) - added:
method HeaderSet.to_header() - added:
method HeaderSet.update(iterable) - added:
variable frozenset
- removed:
function get_ident() - added:
variable get_ident
- changed:
class RequestRedirect(RoutingException) → class RequestRedirect(HTTPException, RoutingException) - changed:
constructor BuildError(endpoint, values) → constructor BuildError(endpoint, values, method) - changed:
constructor MapAdapter(map, server_name, script_name, subdomain, url_scheme, default_method) → constructor MapAdapter(map, server_name, script_name, subdomain, url_scheme, path_info, default_method) - changed:
method Map.bind(server_name, script_name=…, subdomain=…, url_scheme=…, default_method=…) → method Map.bind(server_name, script_name=…, subdomain=…, url_scheme=…, default_method=…, path_info=…) - changed:
method MapAdapter.dispatch(view_func, path_info, method=…) → method MapAdapter.dispatch(view_func, path_info=…, method=…, catch_http_exceptions=…) - changed:
method MapAdapter.match(path_info, method=…) → method MapAdapter.match(path_info=…, method=…) - added:
class AnyConverter(BaseConverter) - added:
constructor AnyConverter(map, *items) - added:
field BaseConverter.weight - added:
field PathConverter.weight - added:
field RequestRedirect.code - added:
method MapAdapter.test(path_info=…, method=…) - added:
method RequestRedirect.get_response(environ) - added:
method Rule.empty()
- added:
class BaseRequestHandler(WSGIRequestHandler) - added:
field BaseRequestHandler.multiprocess - added:
field BaseRequestHandler.multithreaded - added:
function make_server(host, port, app=…, threaded=…, processes=…, request_handler=…) - added:
function reloader_loop(extra_files=…, interval=…) - added:
function restart_with_reloader() - added:
function run_simple(hostname, port, application, use_reloader=…, extra_files=…, reloader_interval=…, threaded=…, processes=…, request_handler=…) - added:
function run_with_reloader(main_func, extra_files=…, interval=…) - added:
method BaseRequestHandler.get_handler() - added:
method BaseRequestHandler.handle() - added:
method BaseRequestHandler.log_error(format, *args) - added:
method BaseRequestHandler.log_message(format, *args) - added:
method BaseRequestHandler.log_request(code=…, size=…) - added:
variable have_wsgiref
- added:
class UserAgent(object) - added:
class UserAgentParser(object) - added:
constructor UserAgent(environ_or_string) - added:
constructor UserAgentParser() - added:
field UserAgentParser.browsers - added:
field UserAgentParser.platforms - added:
method UserAgent.to_header()
- removed:
field BaseRequest.accept_charsets - removed:
field BaseRequest.accept_encodings - removed:
field BaseRequest.accept_languages - removed:
field BaseRequest.accept_mimetypes - removed:
field BaseResponse.cache_control - removed:
method BaseReporterStream.processed() - removed:
method BaseReporterStream.read(size=…) - removed:
method BaseReporterStream.readline(*args) - removed:
method BaseReporterStream.readlines(hint=…) - removed:
method BaseRequest.accept_charsets() - removed:
method BaseRequest.accept_encodings() - removed:
method BaseRequest.accept_languages() - removed:
method BaseRequest.accept_mimetypes() - removed:
method BaseRequest.cache_control() - removed:
method BaseRequest.is_secure() - removed:
method BaseRequest.is_xhr() - removed:
method BaseResponse.add_etag(overwrite=…) - removed:
method BaseResponse.cache_control() - removed:
method BaseResponse.make_conditional(request_or_environ) - added:
class AcceptMixin(object) - added:
class BaseReporterStream(BaseReporterStream) - added:
class CommonResponseDescriptorsMixin(object) - added:
class ETagRequestMixin(object) - added:
class ETagResponseMixin(object) - added:
class Request(BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin) - added:
class Response(BaseResponse, ETagResponseMixin, ResponseStreamMixin, CommonResponseDescriptorsMixin) - added:
class ResponseStream(object) - added:
class ResponseStreamMixin(object) - added:
class UserAgentMixin(object) - added:
constructor ResponseStream(response) - added:
field AcceptMixin.accept_charsets - added:
field AcceptMixin.accept_encodings - added:
field AcceptMixin.accept_languages - added:
field AcceptMixin.accept_mimetypes - added:
field BaseRequest.is_multiprocess - added:
field BaseRequest.is_multithread - added:
field BaseRequest.is_run_once - added:
field BaseResponse.data - added:
field BaseResponse.default_status - added:
field BaseResponse.force_type - added:
field CommonResponseDescriptorsMixin.age - added:
field CommonResponseDescriptorsMixin.allow - added:
field CommonResponseDescriptorsMixin.content_encoding - added:
field CommonResponseDescriptorsMixin.content_language - added:
field CommonResponseDescriptorsMixin.content_length - added:
field CommonResponseDescriptorsMixin.content_location - added:
field CommonResponseDescriptorsMixin.content_md5 - added:
field CommonResponseDescriptorsMixin.content_type - added:
field CommonResponseDescriptorsMixin.date - added:
field CommonResponseDescriptorsMixin.expires - added:
field CommonResponseDescriptorsMixin.last_modified - added:
field CommonResponseDescriptorsMixin.location - added:
field CommonResponseDescriptorsMixin.mimetype - added:
field CommonResponseDescriptorsMixin.retry_after - added:
field CommonResponseDescriptorsMixin.vary - added:
field ETagRequestMixin.cache_control - added:
field ETagRequestMixin.if_match - added:
field ETagRequestMixin.if_modified_since - added:
field ETagRequestMixin.if_none_match - added:
field ETagRequestMixin.if_unmodified_since - added:
field ETagResponseMixin.cache_control - added:
field ResponseStream.closed - added:
field ResponseStream.encoding - added:
field ResponseStream.mode - added:
field ResponseStreamMixin.stream - added:
field UserAgentMixin.user_agent - added:
method AcceptMixin.accept_charsets() - added:
method AcceptMixin.accept_encodings() - added:
method AcceptMixin.accept_languages() - added:
method AcceptMixin.accept_mimetypes() - added:
method BaseResponse.force_type(response, environ=…) - added:
method BaseResponse.freeze() - added:
method ETagRequestMixin.cache_control() - added:
method ETagRequestMixin.if_match() - added:
method ETagRequestMixin.if_modified_since() - added:
method ETagRequestMixin.if_none_match() - added:
method ETagRequestMixin.if_unmodified_since() - added:
method ETagResponseMixin.add_etag(overwrite=…, weak=…) - added:
method ETagResponseMixin.cache_control() - added:
method ETagResponseMixin.freeze(no_etag=…) - added:
method ETagResponseMixin.get_etag() - added:
method ETagResponseMixin.make_conditional(request_or_environ) - added:
method ETagResponseMixin.set_etag(etag, weak=…) - added:
method ResponseStream.close() - added:
method ResponseStream.encoding() - added:
method ResponseStream.flush() - added:
method ResponseStream.isatty() - added:
method ResponseStream.write(value) - added:
method ResponseStream.writelines(seq) - added:
method ResponseStreamMixin.stream() - added:
method UserAgentMixin.user_agent()