Antonio Larrosa
d50a5db5ed
Keep using only filename if it's valid ascii
8 years ago
Antonio Larrosa
bf023e7dc0
Remove unidecode dependency and use unicodedata instead
...
I found a way to remove the unidecode dependency without sacrificing
much by using unicodedata.normalize .
8 years ago
Antonio Larrosa
6ef45f30ab
Fix previous commits to work with python 2 and python 3
...
Also, parse_options_header seems to interpret filename* so we better
test the actual value used in the headers (and since it's valid
in any order, use a set to compare)
8 years ago
Antonio Larrosa
0049922f2e
Fix send_file to work with non-ascii filenames
...
This commit implements https://tools.ietf.org/html/rfc2231#section-4 in
order to support sending unicode characters. Tested on both Firefox and
Chromium under Linux.
This adds unidecode as a dependency, which might be relaxed by using
.encode('latin-1', 'ignore') but wouldn't be as useful.
Also, added a test for the correct headers to be added.
Previously, using a filename parameter to send_file with unicode characters, it
failed with the next error since HTTP headers don't allow non latin-1 characters.
Error on request:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 186, in execute
write(b'')
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 152, in write
self.send_header(key, value)
File "/usr/lib64/python3.6/http/server.py", line 509, in send_header
("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))
UnicodeEncodeError: 'latin-1' codec can't encode character '\uff0f' in position 58: ordinal not in range(256)
Fixes #1286
8 years ago
David Lord
6efea346dd
Merge pull request #2209 from svenstaro/print-stacktrace-on-cli-error
...
Print a stacktrace on CLI error (closes #2208 )
8 years ago
Sven-Hendrik Haase
ed17bc1710
Add test to showcase that printing a traceback works
8 years ago
Sven-Hendrik Haase
ad42d88fb2
Remove useless pass
8 years ago
Sven-Hendrik Haase
5b7fd9ad88
Print a stacktrace on CLI error ( closes #2208 )
8 years ago
Jan Ferko
1add1f8a02
Use print function in quickstart ( #2204 )
...
Example in URL Building section uses `print` statement
instead of `print` function, which causes syntax error
when example is run on Python 3.
8 years ago
John Bodley
46e8427d81
Document run() host defaulting to SERVER_NAME
8 years ago
Ben
7a5e8ef38e
Fix broken link ( #2202 )
8 years ago
Hsiaoming Yang
a7f1a21c12
Don't rely on X-Requested-With for pretty print json response ( #2193 )
...
* Don't rely on X-Requested-With for pretty print json response
* Fix test cases for pretty print json patch
* Fix gramma error in docs for pretty print json config
* Add changelog for JSONIFY_PRETTYPRINT_REGULAR
8 years ago
Static
f5adb61b28
Fix typos/grammar in docs ( #2201 )
8 years ago
Elton Law
06112a555a
Close <li> tag in tutorial ( #2199 )
...
Change was merged in the example code but wasn't changed in the docs. c54d67adee
8 years ago
Adrian
d9a28434af
Fix typo
8 years ago
Grey Li
c43560777a
Add tips for debug config with flask cli ( #2196 )
...
* Add tips for debug config with flask cli
`app.debug` and `app.config['DEBUG']` are not compatible with the `flask` script.
* Grammar fix
* Grammar fix
8 years ago
Sebastian Kalinowski
fca5577a00
Remove extra HTML tag from fileupload docs ( #2141 )
8 years ago
Timothy John Perisho Eccleston
dc5f48f587
Fix typo in docs/tutorial/templates.rst ( #2186 )
8 years ago
Nick Ficano
eaba4a73aa
Fix typo in file header (jsonimpl => json)
8 years ago
Jeff Widman
bb0e755c80
Migrate various docs links to https ( #2180 )
...
Also fixed a few outdated links
8 years ago
Jeff Widman
5efb163237
bdist_wheel replaces wheel ( #2179 )
...
https://packaging.python.org/distributing/#universal-wheels
8 years ago
Markus Unterwaditzer
89798ea7dd
Remove examples dir again
8 years ago
vojtekb
95db82f8f7
py.test => pytest ( #2173 )
...
py.test => pytest
8 years ago
Markus Unterwaditzer
9e2807da76
Merge pull request #2175 from swanhtet1992/patch-1
...
Update 4.4.3 HTTP Methods Example
8 years ago
Swan Htet Aung
f84fdadda9
Update 4.4.3 HTTP Methods Example
...
Otherwise it produces `ValueError: View function did not return a response`.
8 years ago
Armin Ronacher
c9b33d0e86
Convert Flask.run into a noop when run from the CLI
8 years ago
David Lord
42fbbb4cbb
add test and changelog for SERVER_NAME app.run default
...
ref #2152
8 years ago
Raphael Deem
1636a4c410
use SERVER_NAME to set host and port in app.run() ( #2152 )
8 years ago
Jeff Widman
fe7910ccd5
Update docs that request is an object, not a class ( #2154 )
...
Cleanup sphinx formatting to show that `request` is an object, not a class. The actual class name is `Request`.
Based on discussion [here](https://github.com/pallets/flask/pull/2151#issuecomment-272699147 ).
8 years ago
Kim Blomqvist
3fc8be5a4e
Disable debug when FLASK_DEBUG=False ( #2155 )
...
Convert FLASK_DEBUG envvar to lower before test if in tuple
8 years ago
Markus Unterwaditzer
47e8410117
Merge pull request #2131 from wgwz/add-larger-app-ex
...
Add larger app ex
8 years ago
Dennis Chen
9900a72fe7
Fix Request Reference ( #2151 )
...
Points flask.Request to appropriate place in the documentation.
8 years ago
David Lord
6c9ff85c3f
Merge pull request #2149 from onovy/master
...
Use SOURCE_DATE_EPOCH for copyright year to make build reproducible
8 years ago
Ondřej Nový
9dcfd05d29
Use SOURCE_DATE_EPOCH for copyright year to make build reproducible
...
Details: https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
8 years ago
David Lord
22c613b8c4
Merge pull request #2148 from drewja/master
...
Added python3.6 support for tests
8 years ago
Andrew Arendt
01b992b1a1
Added python3.6 support for tests
8 years ago
Adrian Moennich
88111ae6bf
Do not suggest deprecated flask.ext.*
8 years ago
Bryce Guinta
09973a7387
Fix fastcgi lighttpd example documentation. ( #2138 )
...
Add a trailing slash to the dummy path in the fastcgi lighttpd setup
documentation. Omitting a trailing slash leads to unintended behavior.
8 years ago
wgwz
1b7258f816
Provides a link to the examples src
...
- moved the link towards the top for better visibility
8 years ago
wgwz
46c1383919
Remove unneccessary arg in client fixture
8 years ago
wgwz
92fa444259
Moves largerapp into patterns dir and add test
...
- also adds this pattern into tox for testing
8 years ago
Markus Unterwaditzer
49386ee69e
Inherit Werkzeug docs ( #2135 )
...
Fix #2132
8 years ago
Markus Unterwaditzer
71c534d2c6
Merge branch '0.12-maintenance'
8 years ago
Markus Unterwaditzer
b0820bce59
Merge branch 'pawl-fix_import_error' into 0.12-maintenance
...
Fix #2133
8 years ago
Paul Brown
31e25facd3
update change log
8 years ago
Paul Brown
0832e77b14
prevent NoAppException when ImportError occurs within imported module
8 years ago
Markus Unterwaditzer
582a878ad9
Init 0.13 changelog
8 years ago
wgwz
949771adf5
Add reference to largerapp src in docs
8 years ago
wgwz
e49b73d2cf
Adds the largerapp from the docs as an example
8 years ago
Gábor Lipták
079d752cec
Update Flask-SQLAlchemy link ( #2126 )
8 years ago