Commit Graph

111 Commits

Author SHA1 Message Date
David Lord c43edfc7c0
remove simplejson
- remove encoding detection backport, json.loads supports it directly
- use str.translate instead of multiple str.replace
2020-04-07 09:55:39 -07:00
David Lord a0a61acdec
drop support for Python 2.7 and 3.5 2020-04-04 12:09:55 -07:00
David Lord 7673835b3d
remove Python 2 from docs 2020-04-04 12:05:44 -07:00
David Lord 96b4dcafc3
Merge branch '1.1.x' 2020-04-03 10:25:51 -07:00
David Lord 93dd1709d0
release version 1.1.2 2020-04-03 10:10:38 -07:00
David Lord 64ba43411f
Merge remote-tracking branch 'origin/1.1.x' 2020-02-15 10:40:32 -08:00
frostming d4076cf07c
strip the ending slash for static_url_path 2020-02-10 18:19:25 -08:00
David Lord bcde664f9a
cli checks for cryptography library 2020-02-10 17:34:19 -08:00
David Lord ab6e630194
Merge branch '1.1.x' 2020-02-10 16:44:33 -08:00
David Lord ef27c1b749
Merge branch '1.0.x' into 1.1.x 2020-02-10 16:43:49 -08:00
David Lord d92b64aa27
clean up merge 2020-02-10 16:36:40 -08:00
Armin Ronacher 5ceb0a59dd Merge branch '1.1.x' 2020-02-10 20:37:28 +01:00
Armin Ronacher 9b424e9da9 Merge branch '1.0.x' into 1.1.x 2020-02-10 20:37:21 +01:00
Armin Ronacher 2f8086e8c8 Merge remote-tracking branch 'origin/0.12.x' into 1.0.x 2020-02-10 20:36:55 +01:00
David Lord 8d5234e4c7
next version 1.2.0 2020-02-09 15:20:23 -08:00
David Lord 980168d084
send_file doesn't allow StringIO 2019-11-19 08:52:12 -08:00
David Lord 240a11052b
lazy load app on reload only 2019-11-18 17:54:46 -08:00
David Lord aac0f585b9
clean up config.from_file docs 2019-10-18 09:24:58 -07:00
Doron Horwitz 0c0b31a789
get_cookie_name in SessionInterface for easier overriding in SecureCookieSessionInterface 2019-10-12 19:12:27 -07:00
David Lord ded3d642a7
pass sys.argv to flask cli 2019-07-10 12:44:04 -07:00
David Lord c478e5d52f
pass sys.argv to flask cli 2019-07-10 11:45:20 -07:00
David Lord ffc68840f8
release version 1.1.1 2019-07-08 10:58:12 -07:00
David Lord 1617202d91
restore and deprecate json_available 2019-07-08 10:26:12 -07:00
David Lord 1b4ace9ba5
release version 1.1.0 2019-07-04 16:04:42 -07:00
David Lord 8a78fdb09c
Merge branch '1.0.x' 2019-07-04 16:01:14 -07:00
David Lord 626b5cc166
release version 1.0.4 2019-07-04 15:33:46 -07:00
David Lord 2844fdb82e
Merge branch '1.0.x' 2019-07-03 12:23:16 -07:00
ThiefMaster 975f979269 Move dotenv warning to stderr 2019-07-03 15:08:10 +02:00
David Lord b08e35e4ab
show warning for old logger config 2019-07-02 11:39:00 -07:00
David Lord df470aecb9
use app.name as app.logger name 2019-07-01 14:56:18 -07:00
David Lord b05a685a03
Merge branch '1.0.x' 2019-07-01 10:54:31 -07:00
Anthony Sottile a5ecdfa7a5
Fixes for PEP451 import loaders and pytest 5.x
- pytest 5.x drops python2 compatibility and therefore only implements PEP 451
- pytest 5.x made the repr of `ExcInfo` less confusing (fixed tests depending
  on the old format)
2019-07-01 10:43:06 -07:00
David Lord afd6250bab
Merge branch '1.0.x' 2019-07-01 09:52:06 -07:00
Anthony Sottile ac302fb607 Make the changelog UTF-8 compatible 2019-07-01 07:36:20 -07:00
David Lord 54cbb4e642
send_file quotes ":/" in UTF-8 filename 2019-06-27 07:55:22 -07:00
David Lord 2a2134974c
Merge branch '1.0.x' 2019-06-26 14:46:10 -07:00
David Lord 871e6d6a9d
don't clear BadRequestKeyError args 2019-06-26 14:34:03 -07:00
David Lord 1351d0a565
Merge branch '1.0.x' 2019-06-23 16:57:52 -07:00
David Lord 7d77958000
use sphinx-issues, rewrap changelog 2019-06-23 12:25:38 -07:00
David Lord 54519ef028
document behavior of very generic error handlers 2019-06-21 08:22:35 -07:00
David Lord 9054f6d639
always pass InternalServerError instance to 500 handler 2019-06-19 14:52:25 -07:00
David Lord c65863912b
move url matching after opening session 2019-06-13 12:40:01 -07:00
cslecrone 1718f1934c
don't require ssl module for flask cli 2019-05-31 17:27:52 -04:00
Daniel Pope c7f56c5a55 Create json_dumps() method on new EnvironBuilder 2019-05-31 18:05:25 +01:00
John Zeringue 8bb7185284 Better error message when view return type is not supported
Before, returning a `bool` from a route caused the error

```
[2019-05-31 10:08:42,216] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2070, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'bool' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2393, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1906, in full_dispatch_request
    return self.finalize_request(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1921, in finalize_request
    response = self.make_response(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2078, in make_response
    reraise(TypeError, new_error, sys.exc_info()[2])
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/_compat.py", line 39, in reraise
    raise value.with_traceback(tb)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2070, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'bool' object is not callable
The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a bool.
```

Now, it returns the more readable

```
[2019-05-31 10:36:19,500] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2400, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1907, in full_dispatch_request
    return self.finalize_request(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1922, in finalize_request
    response = self.make_response(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2085, in make_response
    " {rv.__class__.__name__}.".format(rv=rv))
TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a bool.
```

Fixes #3214
2019-05-31 11:58:49 -04:00
Fantix King a71c167836
fix teardown bug in FlaskClient
* Fixes pytest-dev/pytest-flask#42
2019-05-25 14:03:28 -07:00
David Lord ed9ab2d3b6
strip static url trailing slash at assignment 2019-05-25 11:18:40 -07:00
Anthony Plunkett ec1ccd7530
Add Blueprint level cli command registration
Implements #1357.
Adds ability to register click cli commands onto blueprint.
2019-05-24 14:43:29 -07:00
pgjones 7bf8366970
Allow dictionary return values as JSON
This supports an increasingly common usecase whereby JSON is the
primary response (rather than a templated string). Given Flask has a
short syntax for HTML reponses, it seems fitting that it should also
do so for JSON responses. In practice it allows,

     @app.route("/")
     def index():
         return {
             "api_stuff": "values",
         }
2019-05-24 09:48:55 -07:00
David Lord e18cc4d71d
add SeparatedPathType to accept multiple paths
Multiple paths for the reloader's `--extra-files` are accepted as one
option, separated by ':'.
2019-05-24 07:19:56 -07:00