Upgrading Flask 0.7 to 0.8
Breaking0.7.2 → 0.8.1Breaking1New9Changed6Fixed4
BreakingUpgrade verdict
1 breaking change.
In plain terms
- Invalid JSON now returns a 400 Bad Request instead of possibly causing a 500 server error.
Must act 1 item needs code or config changes
What you must change
Breaking1
Malformed JSON data now triggers a bad request HTTP exception instead of a value error that could cause a 500 error.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
export admin - added:
export frontend
- added:
variable app - added:
variable here
- added:
method Blueprint.before_app_first_request(f)
- changed:
constructor ConfigAttribute(name) → constructor ConfigAttribute(name, get_converter=…)
- added:
class DebugFilesKeyError(KeyError, AssertionError) - added:
class FormDataRoutingRedirect(AssertionError) - added:
constructor DebugFilesKeyError(request, key) - added:
constructor FormDataRoutingRedirect(request) - added:
function attach_enctype_error_multidict(request)
- added:
function setup()
- added:
function find_package(import_name) - added:
function get_root_path(import_name)
- removed:
class Session(SecureCookie) - removed:
field Session.permanent - added:
variable Session
- added:
class NullSession(SecureCookieSession) - added:
class SecureCookieSession(SecureCookie, SessionMixin) - added:
class SecureCookieSessionInterface(SessionInterface) - added:
class SessionInterface(object) - added:
class SessionMixin(object) - added:
field NullSession.clear - added:
field NullSession.pop - added:
field NullSession.popitem - added:
field NullSession.setdefault - added:
field NullSession.update - added:
field SecureCookieSessionInterface.session_class - added:
field SessionInterface.null_session_class - added:
field SessionMixin.modified - added:
field SessionMixin.new - added:
field SessionMixin.permanent - added:
method SecureCookieSessionInterface.open_session(app, request) - added:
method SecureCookieSessionInterface.save_session(app, session, response) - added:
method SessionInterface.get_cookie_domain(app) - added:
method SessionInterface.get_cookie_httponly(app) - added:
method SessionInterface.get_cookie_path(app) - added:
method SessionInterface.get_cookie_secure(app) - added:
method SessionInterface.get_expiration_time(app, session) - added:
method SessionInterface.is_null_session(obj) - added:
method SessionInterface.make_null_session(app) - added:
method SessionInterface.open_session(app, request) - added:
method SessionInterface.save_session(app, session, response)
- added:
class BasicFunctionalityTestCase(FlaskTestCase) - added:
class ContextTestCase(FlaskTestCase) - added:
class SubdomainTestCase(FlaskTestCase) - added:
function suite() - added:
method BasicFunctionalityTestCase.test_before_after_request_order() - added:
method BasicFunctionalityTestCase.test_before_first_request_functions() - added:
method BasicFunctionalityTestCase.test_before_request_and_routing_errors() - added:
method BasicFunctionalityTestCase.test_custom_converters() - added:
method BasicFunctionalityTestCase.test_debug_mode_complains_after_first_request() - added:
method BasicFunctionalityTestCase.test_enctype_debug_helper() - added:
method BasicFunctionalityTestCase.test_endpoint_decorator() - added:
method BasicFunctionalityTestCase.test_error_handling() - added:
method BasicFunctionalityTestCase.test_exception_propagation() - added:
method BasicFunctionalityTestCase.test_extended_flashing() - added:
method BasicFunctionalityTestCase.test_flashes() - added:
method BasicFunctionalityTestCase.test_make_response() - added:
method BasicFunctionalityTestCase.test_max_content_length() - added:
method BasicFunctionalityTestCase.test_missing_session() - added:
method BasicFunctionalityTestCase.test_none_response() - added:
method BasicFunctionalityTestCase.test_options_handling_disabled() - added:
method BasicFunctionalityTestCase.test_options_on_multiple_rules() - added:
method BasicFunctionalityTestCase.test_options_work() - added:
method BasicFunctionalityTestCase.test_preserve_only_once() - added:
method BasicFunctionalityTestCase.test_proper_test_request_context() - added:
method BasicFunctionalityTestCase.test_request_dispatching() - added:
method BasicFunctionalityTestCase.test_request_locals() - added:
method BasicFunctionalityTestCase.test_request_processing() - added:
method BasicFunctionalityTestCase.test_response_creation() - added:
method BasicFunctionalityTestCase.test_route_decorator_custom_endpoint() - added:
method BasicFunctionalityTestCase.test_routing_redirect_debugging() - added:
method BasicFunctionalityTestCase.test_session() - added:
method BasicFunctionalityTestCase.test_session_expiration() - added:
method BasicFunctionalityTestCase.test_session_using_application_root() - added:
method BasicFunctionalityTestCase.test_session_using_server_name() - added:
method BasicFunctionalityTestCase.test_session_using_server_name_and_port() - added:
method BasicFunctionalityTestCase.test_session_using_session_settings() - added:
method BasicFunctionalityTestCase.test_static_files() - added:
method BasicFunctionalityTestCase.test_teardown_on_pop() - added:
method BasicFunctionalityTestCase.test_teardown_request_handler() - added:
method BasicFunctionalityTestCase.test_teardown_request_handler_debug_mode() - added:
method BasicFunctionalityTestCase.test_teardown_request_handler_error() - added:
method BasicFunctionalityTestCase.test_test_app_proper_environ() - added:
method BasicFunctionalityTestCase.test_trapping_of_all_http_exceptions() - added:
method BasicFunctionalityTestCase.test_trapping_of_bad_request_key_errors() - added:
method BasicFunctionalityTestCase.test_url_generation() - added:
method BasicFunctionalityTestCase.test_url_mapping() - added:
method BasicFunctionalityTestCase.test_url_processors() - added:
method BasicFunctionalityTestCase.test_user_error_handling() - added:
method BasicFunctionalityTestCase.test_werkzeug_routing() - added:
method ContextTestCase.test_context_binding() - added:
method ContextTestCase.test_context_test() - added:
method ContextTestCase.test_manual_context_binding() - added:
method SubdomainTestCase.test_basic_support() - added:
method SubdomainTestCase.test_module_static_path_subdomain() - added:
method SubdomainTestCase.test_module_subdomain_support() - added:
method SubdomainTestCase.test_subdomain_matching() - added:
method SubdomainTestCase.test_subdomain_matching_with_ports()
- added:
class BlueprintTestCase(FlaskTestCase) - added:
class ModuleTestCase(FlaskTestCase) - added:
function suite() - added:
method BlueprintTestCase.test_blueprint_specific_error_handling() - added:
method BlueprintTestCase.test_blueprint_url_definitions() - added:
method BlueprintTestCase.test_blueprint_url_processors() - added:
method BlueprintTestCase.test_dotted_names() - added:
method BlueprintTestCase.test_empty_url_defaults() - added:
method BlueprintTestCase.test_route_decorator_custom_endpoint() - added:
method BlueprintTestCase.test_route_decorator_custom_endpoint_with_dots() - added:
method BlueprintTestCase.test_templates_and_static() - added:
method BlueprintTestCase.test_templates_list() - added:
method ModuleTestCase.test_basic_module() - added:
method ModuleTestCase.test_context_processors() - added:
method ModuleTestCase.test_default_endpoint_name() - added:
method ModuleTestCase.test_endpoint_decorator() - added:
method ModuleTestCase.test_error_handling() - added:
method ModuleTestCase.test_late_binding() - added:
method ModuleTestCase.test_request_processing() - added:
method ModuleTestCase.test_safe_access() - added:
method ModuleTestCase.test_templates_and_static()
- added:
class ConfigTestCase(FlaskTestCase) - added:
class InstanceTestCase(FlaskTestCase) - added:
function suite() - added:
method ConfigTestCase.common_object_test(app) - added:
method ConfigTestCase.test_config_from_class() - added:
method ConfigTestCase.test_config_from_envvar() - added:
method ConfigTestCase.test_config_from_file() - added:
method ConfigTestCase.test_config_from_object() - added:
method ConfigTestCase.test_config_missing() - added:
method ConfigTestCase.test_session_lifetime() - added:
method InstanceTestCase.test_egg_installed_paths() - added:
method InstanceTestCase.test_explicit_instance_paths() - added:
method InstanceTestCase.test_installed_module_paths() - added:
method InstanceTestCase.test_installed_package_paths() - added:
method InstanceTestCase.test_prefix_installed_paths() - added:
method InstanceTestCase.test_uninstalled_module_paths() - added:
method InstanceTestCase.test_uninstalled_package_paths() - added:
variable SECRET_KEY - added:
variable TEST_KEY
- added:
class DeprecationsTestCase(FlaskTestCase) - added:
function suite() - added:
method DeprecationsTestCase.test_init_jinja_globals()
- added:
class ExtImportHookTestCase(FlaskTestCase) - added:
function suite() - added:
method ExtImportHookTestCase.setup() - added:
method ExtImportHookTestCase.teardown() - added:
method ExtImportHookTestCase.test_flaskext_broken_package_no_module_caching() - added:
method ExtImportHookTestCase.test_flaskext_new_package_import_module() - added:
method ExtImportHookTestCase.test_flaskext_new_package_import_normal() - added:
method ExtImportHookTestCase.test_flaskext_new_package_import_submodule() - added:
method ExtImportHookTestCase.test_flaskext_new_package_import_submodule_function() - added:
method ExtImportHookTestCase.test_flaskext_new_simple_import_module() - added:
method ExtImportHookTestCase.test_flaskext_new_simple_import_normal() - added:
method ExtImportHookTestCase.test_flaskext_old_package_import_module() - added:
method ExtImportHookTestCase.test_flaskext_old_package_import_normal() - added:
method ExtImportHookTestCase.test_flaskext_old_package_import_submodule() - added:
method ExtImportHookTestCase.test_flaskext_old_package_import_submodule_function() - added:
method ExtImportHookTestCase.test_flaskext_old_simple_import_module() - added:
method ExtImportHookTestCase.test_flaskext_old_simple_import_normal() - added:
method ExtImportHookTestCase.test_no_error_swallowing()
- added:
class JSONTestCase(FlaskTestCase) - added:
class LoggingTestCase(FlaskTestCase) - added:
class SendfileTestCase(FlaskTestCase) - added:
field JSONTestCase.test_modified_url_encoding - added:
function has_encoding(name) - added:
function suite() - added:
method JSONTestCase.test_json_attr() - added:
method JSONTestCase.test_json_bad_requests() - added:
method JSONTestCase.test_json_body_encoding() - added:
method JSONTestCase.test_jsonify() - added:
method JSONTestCase.test_modified_url_encoding() - added:
method JSONTestCase.test_template_escaping() - added:
method LoggingTestCase.test_debug_log() - added:
method LoggingTestCase.test_exception_logging() - added:
method LoggingTestCase.test_logger_cache() - added:
method LoggingTestCase.test_processor_exceptions() - added:
method SendfileTestCase.test_attachment() - added:
method SendfileTestCase.test_send_file_object() - added:
method SendfileTestCase.test_send_file_regular() - added:
method SendfileTestCase.test_send_file_xsendfile()
- added:
class SignalsTestCase(FlaskTestCase) - added:
function suite() - added:
method SignalsTestCase.test_request_exception_signal() - added:
method SignalsTestCase.test_request_signals() - added:
method SignalsTestCase.test_template_rendered()
- added:
class FlaskSubclassingTestCase(FlaskTestCase) - added:
function suite() - added:
method FlaskSubclassingTestCase.test_supressed_exception_logging()
- added:
class TemplatingTestCase(FlaskTestCase) - added:
function suite() - added:
method TemplatingTestCase.test_context_processing() - added:
method TemplatingTestCase.test_custom_template_loader() - added:
method TemplatingTestCase.test_escaping() - added:
method TemplatingTestCase.test_macros() - added:
method TemplatingTestCase.test_no_escaping() - added:
method TemplatingTestCase.test_original_win() - added:
method TemplatingTestCase.test_standard_context() - added:
method TemplatingTestCase.test_template_filter() - added:
method TemplatingTestCase.test_template_filter_with_name() - added:
method TemplatingTestCase.test_template_filter_with_name_and_template() - added:
method TemplatingTestCase.test_template_filter_with_template()
- added:
class ViewTestCase(FlaskTestCase) - added:
function suite() - added:
method ViewTestCase.common_test(app) - added:
method ViewTestCase.test_basic_view() - added:
method ViewTestCase.test_explicit_head() - added:
method ViewTestCase.test_implicit_head() - added:
method ViewTestCase.test_method_based_view() - added:
method ViewTestCase.test_view_decorators() - added:
method ViewTestCase.test_view_inheritance() - added:
method ViewTestCase.test_view_patching()
- added:
field View.decorators
- added:
method Request.on_json_loading_failed(e)
- added:
variable ext_id
- added:
function test_function()
- added:
variable ext_id
- added:
function test_function()
- added:
variable ext_id
- removed:
function create_app(config_overrides=…) - removed:
variable db