Skip to content

Commit 717e45a

Browse files
committed
Merge branch 'master' into routes-command
2 parents 1b764cf + 71b7c4f commit 717e45a

File tree

119 files changed

+1980
-1022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1980
-1022
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGES merge=union

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ _mailinglist
1111
.tox
1212
.cache/
1313
.idea/
14+
15+
# Coverage reports
16+
htmlcov
17+
.coverage
18+
.coverage.*
19+
*,cover

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ python:
88
- "3.3"
99
- "3.4"
1010
- "3.5"
11+
- "3.6"
1112

1213
env:
1314
- REQUIREMENTS=lowest
@@ -32,7 +33,10 @@ matrix:
3233
env: REQUIREMENTS=lowest
3334
- python: "3.5"
3435
env: REQUIREMENTS=lowest-simplejson
35-
36+
- python: "3.6"
37+
env: REQUIREMENTS=lowest
38+
- python: "3.6"
39+
env: REQUIREMENTS=lowest-simplejson
3640

3741
install:
3842
- pip install tox

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Patches and Suggestions
2121
- Florent Xicluna
2222
- Georg Brandl
2323
- Jeff Widman @jeffwidman
24+
- Joshua Bronson @jab
2425
- Justin Quick
2526
- Kenneth Reitz
2627
- Keyan Pishdadian

CHANGES

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,79 @@ Flask Changelog
33

44
Here you can see the full list of changes between each Flask release.
55

6+
Version 0.13
7+
------------
8+
9+
Major release, unreleased
10+
11+
- Make `app.run()` into a noop if a Flask application is run from the
12+
development server on the command line. This avoids some behavior that
13+
was confusing to debug for newcomers.
14+
- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()
15+
method returns compressed response by default, and pretty response in
16+
debug mode.
17+
- Change Flask.__init__ to accept two new keyword arguments, ``host_matching``
18+
and ``static_host``. This enables ``host_matching`` to be set properly by the
19+
time the constructor adds the static route, and enables the static route to
20+
be properly associated with the required host. (``#1559``)
21+
- ``send_file`` supports Unicode in ``attachment_filename``. (`#2223`_)
22+
- Pass ``_scheme`` argument from ``url_for`` to ``handle_build_error``.
23+
(`#2017`_)
24+
- Add support for ``provide_automatic_options`` in ``add_url_rule`` to disable
25+
adding OPTIONS method when the ``view_func`` argument is not a class.
26+
(`#1489`_).
27+
- ``MethodView`` can inherit method handlers from base classes. (`#1936`_)
28+
- Errors caused while opening the session at the beginning of the request are
29+
handled by the app's error handlers. (`#2254`_)
30+
- Blueprints gained ``json_encoder`` and ``json_decoder`` attributes to
31+
override the app's encoder and decoder. (`#1898`_)
32+
- ``Flask.make_response`` raises ``TypeError`` instead of ``ValueError`` for
33+
bad response types. The error messages have been improved to describe why the
34+
type is invalid. (`#2256`_)
35+
36+
.. _#1489: https://github.com/pallets/flask/pull/1489
37+
.. _#1898: https://github.com/pallets/flask/pull/1898
38+
.. _#1936: https://github.com/pallets/flask/pull/1936
39+
.. _#2017: https://github.com/pallets/flask/pull/2017
40+
.. _#2223: https://github.com/pallets/flask/pull/2223
41+
.. _#2254: https://github.com/pallets/flask/pull/2254
42+
.. _#2256: https://github.com/pallets/flask/pull/2256
43+
44+
Version 0.12.1
45+
--------------
46+
47+
Bugfix release, released on March 31st 2017
48+
49+
- Prevent `flask run` from showing a NoAppException when an ImportError occurs
50+
within the imported application module.
51+
- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix
52+
``#2118``.
53+
- Use the ``SERVER_NAME`` config if it is present as default values for
54+
``app.run``. ``#2109``, ``#2152``
55+
- Call `ctx.auto_pop` with the exception object instead of `None`, in the
56+
event that a `BaseException` such as `KeyboardInterrupt` is raised in a
57+
request handler.
58+
659
Version 0.12
760
------------
861

62+
Released on December 21st 2016, codename Punsch.
63+
964
- the cli command now responds to `--version`.
10-
- Mimetype guessing for ``send_file`` has been removed, as per issue ``#104``.
11-
See pull request ``#1849``.
65+
- Mimetype guessing and ETag generation for file-like objects in ``send_file``
66+
has been removed, as per issue ``#104``. See pull request ``#1849``.
67+
- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall back to
68+
``application/octet-stream``. See pull request ``#1988``.
1269
- Make ``flask.safe_join`` able to join multiple paths like ``os.path.join``
1370
(pull request ``#1730``).
71+
- Revert a behavior change that made the dev server crash instead of returning
72+
a Internal Server Error (pull request ``#2006``).
73+
- Correctly invoke response handlers for both regular request dispatching as
74+
well as error handlers.
75+
- Disable logger propagation by default for the app logger.
76+
- Add support for range requests in ``send_file``.
77+
- ``app.test_client`` includes preset default environment, which can now be
78+
directly set, instead of per ``client.get``.
1479

1580
Version 0.11.2
1681
--------------
@@ -325,7 +390,7 @@ Released on September 29th 2011, codename Rakija
325390
- Applications now not only have a root path where the resources and modules
326391
are located but also an instance path which is the designated place to
327392
drop files that are modified at runtime (uploads etc.). Also this is
328-
conceptionally only instance depending and outside version control so it's
393+
conceptually only instance depending and outside version control so it's
329394
the perfect place to put configuration files etc. For more information
330395
see :ref:`instance-folders`.
331396
- Added the ``APPLICATION_ROOT`` configuration variable.

CONTRIBUTING.rst

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Submitting patches
2828
clearly under which circumstances the bug happens. Make sure the test fails
2929
without your patch.
3030

31-
- Try to follow `PEP8 <http://legacy.python.org/dev/peps/pep-0008/>`_, but you
31+
- Try to follow `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_, but you
3232
may ignore the line-length-limit if following it would make the code uglier.
3333

3434

@@ -38,7 +38,7 @@ Running the testsuite
3838
You probably want to set up a `virtualenv
3939
<https://virtualenv.readthedocs.io/en/latest/index.html>`_.
4040

41-
The minimal requirement for running the testsuite is ``py.test``. You can
41+
The minimal requirement for running the testsuite is ``pytest``. You can
4242
install it with::
4343

4444
pip install pytest
@@ -54,9 +54,9 @@ Install Flask as an editable package using the current source::
5454

5555
Then you can run the testsuite with::
5656

57-
py.test
57+
pytest
5858

59-
With only py.test installed, a large part of the testsuite will get skipped
59+
With only pytest installed, a large part of the testsuite will get skipped
6060
though. Whether this is relevant depends on which part of Flask you're working
6161
on. Travis is set up to run the full testsuite when you submit your pull
6262
request anyways.
@@ -79,11 +79,36 @@ plugin. This assumes you have already run the testsuite (see previous section):
7979

8080
After this has been installed, you can output a report to the command line using this command::
8181

82-
py.test --cov=flask tests/
82+
pytest --cov=flask tests/
8383

8484
Generate a HTML report can be done using this command::
8585

86-
py.test --cov-report html --cov=flask tests/
86+
pytest --cov-report html --cov=flask tests/
8787

8888
Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io
8989

90+
Caution
91+
=======
92+
pushing
93+
-------
94+
This repository contains several zero-padded file modes that may cause issues when pushing this repository to git hosts other than github. Fixing this is destructive to the commit history, so we suggest ignoring these warnings. If it fails to push and you're using a self-hosted git service like Gitlab, you can turn off repository checks in the admin panel.
95+
96+
97+
cloning
98+
-------
99+
The zero-padded file modes files above can cause issues while cloning, too. If you have
100+
101+
::
102+
103+
[fetch]
104+
fsckobjects = true
105+
106+
or
107+
108+
::
109+
110+
[receive]
111+
fsckObjects = true
112+
113+
114+
set in your git configuration file, cloning this repository will fail. The only solution is to set both of the above settings to false while cloning, and then setting them back to true after the cloning is finished.

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
all: clean-pyc test
44

55
test:
6-
pip install -r test-requirements.txt -q
7-
FLASK_DEBUG= py.test tests examples
8-
9-
tox-test:
10-
tox
6+
pip install -r test-requirements.txt
7+
tox -e py-release
118

129
audit:
1310
python setup.py audit

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
Good that you're asking. The tests are in the
3535
tests/ folder. To run the tests use the
36-
`py.test` testing tool:
36+
`pytest` testing tool:
3737

38-
$ py.test
38+
$ pytest
3939

4040
Details on contributing can be found in CONTRIBUTING.rst
4141

docs/_templates/sidebarintro.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h3>Other Formats</h3>
1616
<h3>Useful Links</h3>
1717
<ul>
1818
<li><a href="http://flask.pocoo.org/">The Flask Website</a></li>
19-
<li><a href="http://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li>
20-
<li><a href="http://github.com/pallets/flask">Flask @ GitHub</a></li>
21-
<li><a href="http://github.com/pallets/flask/issues">Issue Tracker</a></li>
19+
<li><a href="https://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li>
20+
<li><a href="https://github.com/pallets/flask">Flask @ GitHub</a></li>
21+
<li><a href="https://github.com/pallets/flask/issues">Issue Tracker</a></li>
2222
</ul>

docs/api.rst

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -30,61 +30,12 @@ Incoming Request Data
3030

3131
.. autoclass:: Request
3232
:members:
33-
34-
.. attribute:: form
35-
36-
A :class:`~werkzeug.datastructures.MultiDict` with the parsed form data from ``POST``
37-
or ``PUT`` requests. Please keep in mind that file uploads will not
38-
end up here, but instead in the :attr:`files` attribute.
39-
40-
.. attribute:: args
41-
42-
A :class:`~werkzeug.datastructures.MultiDict` with the parsed contents of the query
43-
string. (The part in the URL after the question mark).
44-
45-
.. attribute:: values
46-
47-
A :class:`~werkzeug.datastructures.CombinedMultiDict` with the contents of both
48-
:attr:`form` and :attr:`args`.
49-
50-
.. attribute:: cookies
51-
52-
A :class:`dict` with the contents of all cookies transmitted with
53-
the request.
54-
55-
.. attribute:: stream
56-
57-
If the incoming form data was not encoded with a known mimetype
58-
the data is stored unmodified in this stream for consumption. Most
59-
of the time it is a better idea to use :attr:`data` which will give
60-
you that data as a string. The stream only returns the data once.
61-
62-
.. attribute:: headers
63-
64-
The incoming request headers as a dictionary like object.
65-
66-
.. attribute:: data
67-
68-
Contains the incoming request data as string in case it came with
69-
a mimetype Flask does not handle.
70-
71-
.. attribute:: files
72-
73-
A :class:`~werkzeug.datastructures.MultiDict` with files uploaded as part of a
74-
``POST`` or ``PUT`` request. Each file is stored as
75-
:class:`~werkzeug.datastructures.FileStorage` object. It basically behaves like a
76-
standard file object you know from Python, with the difference that
77-
it also has a :meth:`~werkzeug.datastructures.FileStorage.save` function that can
78-
store the file on the filesystem.
33+
:inherited-members:
7934

8035
.. attribute:: environ
8136

8237
The underlying WSGI environment.
8338

84-
.. attribute:: method
85-
86-
The current request method (``POST``, ``GET`` etc.)
87-
8839
.. attribute:: path
8940
.. attribute:: full_path
9041
.. attribute:: script_root
@@ -114,15 +65,8 @@ Incoming Request Data
11465
`url_root` ``u'http://www.example.com/myapplication/'``
11566
============= ======================================================
11667

117-
.. attribute:: is_xhr
118-
119-
``True`` if the request was triggered via a JavaScript
120-
`XMLHttpRequest`. This only works with libraries that support the
121-
``X-Requested-With`` header and set it to `XMLHttpRequest`.
122-
Libraries that do that are prototype, jQuery and Mochikit and
123-
probably some more.
12468

125-
.. class:: request
69+
.. attribute:: request
12670

12771
To access incoming request data, you can use the global `request`
12872
object. Flask parses incoming request data for you and gives you
@@ -316,13 +260,7 @@ Useful Functions and Classes
316260

317261
.. autofunction:: url_for
318262

319-
.. function:: abort(code)
320-
321-
Raises an :exc:`~werkzeug.exceptions.HTTPException` for the given
322-
status code. For example to abort request handling with a page not
323-
found exception, you would call ``abort(404)``.
324-
325-
:param code: the HTTP error code.
263+
.. autofunction:: abort
326264

327265
.. autofunction:: redirect
328266

docs/appcontext.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ The application context is also used by the :func:`~flask.url_for`
7474
function in case a ``SERVER_NAME`` was configured. This allows you to
7575
generate URLs even in the absence of a request.
7676

77-
If no request context has been pushed and an application context has
78-
not been explicitly set, a ``RuntimeError`` will be raised.
79-
::
77+
If no request context has been pushed and an application context has
78+
not been explicitly set, a ``RuntimeError`` will be raised. ::
79+
8080
RuntimeError: Working outside of application context.
8181

8282
Locality of the Context

docs/becomingbig.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Flask started in part to demonstrate how to build your own framework on top of
1212
existing well-used tools Werkzeug (WSGI) and Jinja (templating), and as it
1313
developed, it became useful to a wide audience. As you grow your codebase,
1414
don't just use Flask -- understand it. Read the source. Flask's code is
15-
written to be read; it's documentation is published so you can use its internal
15+
written to be read; its documentation is published so you can use its internal
1616
APIs. Flask sticks to documented APIs in upstream libraries, and documents its
1717
internal utilities so that you can find the hook points needed for your
1818
project.

0 commit comments

Comments
 (0)