| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
My oh my. Thank goodness I clicked this link while I was at my home had I been in the office space, it would be disastrous.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
getfullargspec was deprecated in 3.5 and un-deprecated in 3.6,
so we can use that and do not need the inspect.signature() based
polyfill.
|
| |
|
|
|
|
|
|
|
| |
Python implements __del__ for NamedTemporaryFile (with some
additional tricks) to make sure these are closed (and unlinked)
if they are no longer referenced. This avoids the ResourceWarning
you'd normally get if an unclosed file is garbage-collected.
|
|
|
|
| |
Signed-off-by: akgnah <1024@setq.me>
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
add GitHub URL for PyPi
|
|/ |
|
|
|
|
|
|
| |
Previously, if the If-Modified-Since header was an empty string it wouldn't
be parsed into an int (or None), but would still be compared to the int
mtime, causing a TypeError.
|
|
|
| |
Update to inclusive language. See #1361 for context.
|
|
|
|
|
|
|
| |
This commit fixes a bug where setting an existing, read-only property
of a BaseRequest object does not raise an AttributeError.
Fixes #1359
|
|\
| |
| | |
Update the copyright year
|
| | |
|
|\ \
| |/
|/| |
Typo in docstring
|
|/ |
|
|
|
| |
Change capitalization to title case for consistency.
|
| |
|
| |
|
| |
|
|
|
| |
a little clearer
|
| |
|
|
|
|
|
| |
The adapter is deprecated, only cherrypy <9 is supported, and that breaks
tests for Python 3.9.
|
| |
|
|
|
|
| |
from <module:name GET /route> to <GET /route -> module:name>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current improvement really helps when using multiple apps.
When I start such an application I like logging which routes are
available, for example one can do:
```
for r in main_app.routes:
print(r)
```
Which previously gave this:
```
<GET '<:re:(de|us)?\\/?>' <function index at 0x7f750fda9670>>
<GET '/<:re:(de/|us/)?>hello/<name:path>/<_id:int>/' <function _index_with_param at 0x7f750fda9700>>
<GET '/<:re:(de/|us/)?><:re:foo>/' <function _index at 0x7f750fda9820>>
<GET '/<:re:(de/|us/)?><url:path>/' <function main at 0x7f750fda9940>>
<GET '<:re:(de|us)?\\/?>' <function main at 0x7f750fda9940>>
<GET '/admin/login/' <function Auth.get_login_template at 0x7f751061e670>>
<POST '/admin/login/' <function Auth.post_login_template at 0x7f751061e700>>
<GET '/admin/' <function index at 0x7f750fd21940>>
<GET '/editor/' <function editor at 0x7f750f930ca0>>
<POST '/editor/template/' <function template_ at 0x7f750f930dc0>>
<GET '/editor/preview/<name:path>' <function load_tmp_template at 0x7f750f930ee0>>
<POST '/editor/validate-jinja/' <function convert at 0x7f750f937040>>
<GET '/static/front/<filepath:path>' <function app_factory.<locals>.server_static at 0x7f750f937af0>>
<GET '/static/admin/<filepath:path>' <function app_factory.<locals>.server_static at 0x7f750f937c10>>
<GET '/static/editor/<filepath:path>' <function app_factory.<locals>.server_static at 0x7f750f937d30>>
```
Memory addresses are of very little use (I can only tell which route is
which because I mount them to different prefixes (e.g. editor, admin,
etc.). This also mathes the directory structure on the file system.
However, this is not always the case, some times I mount applications
without prefix.
With the current patch I can immidietly tell where a route is coming
from:
```
apps.front.views:index GET <:re:(de|us)?\/?>
apps.front.views:_index_with_param GET /<:re:(de/|us/)?>hello/<name:path>/<_id:int>/
apps.front.views:_index GET /<:re:(de/|us/)?><:re:foo>/
apps.front.views:main GET /<:re:(de/|us/)?><url:path>/
apps.front.views:main GET <:re:(de|us)?\/?>
tiny.auth:get_login_template GET /admin/login/
tiny.auth:post_login_template POST /admin/login/
apps.admin.views:index GET /admin/
apps.editor.views:editor GET /editor/
apps.editor.views:template_ POST /editor/template/
apps.editor.views:load_tmp_template GET /editor/preview/<name:path>
apps.editor.views:convert POST /editor/validate-jinja/
__main__:server_static GET /static/front/<filepath:path>
__main__:server_static GET /static/admin/<filepath:path>
__main__:server_static GET /static/editor/<filepath:path>
```
I think this little patch might be usefull for others too.
|
| |
|
| |
|
|
|
|
|
| |
fapws3 is unmaintained for 3 years and breaks tests.
Python 3.5 is end-of-life.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This logic was added to satisfy pep-3333, where the error handling section
says application authors should "never trap errors raised by start_response
when exc_info is being provided".
However, this appears to be intended to prevent applications from catching
exc_info being re-raised by start_response(), which happens when an
application tries to send an error response (includes exc_info), but can't
as output has already been written to the client. These exceptions should
be thrown up to the server so it can abort the connection, not caught by
the application.
In this case, the start_response() call in question may be an error
response, but it's always the first call to start_response(), so should
never re-raise exc_info in this way. As such, the special handling is
unnecessary.
|
|
|
|
| |
Hope it's enough. Exception raising in wsgi() is covered
|
|
|
|
|
|
|
|
|
|
|
| |
Recommended by pep-3333 to enable middleware to provide exception handling
services, e.g. custom exception logging.
See https://www.python.org/dev/peps/pep-3333/#error-handling
Note that the exc_info is temporarily stored in the environ to pass it up
from _handler() to wsgi(), where start_response() is called. There may be
a better way to do this, e.g. storing it in the response object.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This are tested and should work for all users running
Python3.8 and Python3.9.
|
|
|
|
| |
This version is EOL since 2020-09-05.
|
|
|
|
| |
This Python version is EOL since 2019-03-18.
|
|
|
|
|
| |
Mutating the passed in dict can produce unexpected results if the caller
re-uses the dict, e.g. uses the same set of headers for multiple files.
|