| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* Use is_alive instead of isAlive for Python 3.9 compatibility.
* Use encodebytes instead of deprecated encodestring.
* Fix Python 2 and 3 compatibility for base64.
|
| |
|
| |
|
|
|
| |
On Python 3, socket.makefile() returns an object with a tell() method, but one that always raises io.UnsupportedOperation.
|
|
|
| |
If we don't want to parse the request body with cgi, we can just not use cgi rather than building a fake request.
|
|
|
| |
Passing a unicode url to get() always worked (assuming the url contained only ASCII), but it didn't work to post(), put(), or delete() if query parameters were included. This change fixes the latter cases.
|
|
|
|
| |
it's done. (#32)
|
|
|
|
|
| |
On Python 3, cgi.FieldStorage has a __del__ method that closes the underlying file [1]. This means that if the copy made from UnicodeMultiDict._decode_value is garbage collected, the file underlying the original FieldStorage will be closed! Fix this by not copying FieldStorage if it is not required by decode_keys=False. I cannot think of a nice way to fix this problem if decode_keys=True.
[1] https://github.com/python/cpython/commit/f79126f373a9d5c9b584a8db736fe490fcbfa77a
|
|
|
| |
As the test shows, this fixes passing boths params and upload_files on Python 3.
|
|
|
| |
Replace `isinstance(self.content, file)` with a duck type for the `read()` method. Having a read method is what PEP 333 defines as the minimum requirement for a "file-like" object.
|
|
|
| |
This fixes a deprecation warning on 3.7.
|
| |
|
|
|
|
|
|
|
|
| |
httpservers writes an empty string or an internal server
error message, these needs to be bytes in python 3.
It might have been useful to have wsgi_write_chunk accept
either bytes or strings and do the right thing, but that
seemed too invasive to be safe.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 78dd2ec0138467305f1686558fca4ff8ca0b2b70.
That removes the use of the so-called "thread safe" tsafe module, which
adds a lock around many messages, but did not account for the use of
that lock in the paste/httpserver.py module.
An attempt was made to just get rid of that lock, but since there is
limited testing of that area, and few resources to confirm the change,
it's been decided that keeping tsafe and allow the deprecation warning
to be exposed is the best thing to do. With luck the decpration warning
will encourage people to not use the httpserver and choose something
else instead.
Fixes #19
|
| |
|
| |
|
|
|
|
|
| |
It would fail if the length of bytes and unicode differs.
It now passes non-bytes to `Form` directly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* py3 fixes for form handling in paste.fixture
It uses "not six.PY2" in contrast to other places in the code to be
forward-compatible.
I've not looked too closely, but it might make sense to decode body/text
in the beginning already, instead of having it as bytes internally?!
Also, like mentioned in [1] already, it should probably use the correct
source encoding?!
1: https://github.com/cdent/paste/blob/36e5b8bd16a6063ec654faf04541f3a20d19f7fe/paste/fixture.py#L820
* Add test, using/fixing SlowConsumer form app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* pytest: fix collection warnings via __test__=False
Fixes
> "cannot collect test class %r because it has a __init__ constructor
Ref: https://github.com/pytest-dev/pytest/issues/2007
* pytest: configure testpaths
This is faster with test collection.
* pytest: fix warning with doctests
Fixes
> /usr/lib/python3.7/site-packages/_pytest/python.py:764:
> RemovedInPytest4Warning: usage of Generator.Function is deprecated,
> please use pytest.Function instead
* Minor fixes around s/py.test/pytest/
|
|
|
|
|
|
|
|
| |
Future is calling installation endless recursion. We are only
using it for an html.escape method, so we make our own and get
rid of future.
Related-Bug: #6
|
|
|
|
|
|
|
|
| |
In Python3, the iterator protocol uses a method named __next__(), not
next(). (For compatibility with Python 2.6, we still need to support
both though.) Ensure all iterator objects support the Python3 protocol.
Signed-off-by: Zane Bitter <zbitter@redhat.com>
|
|
|
|
|
|
| |
This will cause a runtime error in Python 3.7, due to PEP479.
Signed-off-by: Zane Bitter <zbitter@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pytest exposes many warnings, some but not all of which are cleaned
up here. The main switch is to use html.escape instead of cgi.escape.
This inspired the addition of 'future' to requirements.
The remaining warnings are related to pytest deprecations or over-eager
test discovery.
It is perhaps ironic that the switch to pytest is to avoid nose being
mostly dead, and now we are using features in pytest that pytest wants
to make dead. These are left for later cleanups, which means that
running the tests is noisy.
|
|\
| |
| |
| | |
Use correct variable when building message for exception
|
| |
| |
| |
| |
| | |
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695253
|
| |
| |
| |
| | |
so we avoid logic duplication
|
| | |
|
| |\ |
|
| | |
| | |
| | |
| | | |
to support using `add_close` objects as iterators on Python 3.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, when the listening socket was already in use, this error message was displayed:
...
File "/private/tmp/n/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 1106, in server_close
self.thread_pool.shutdown(60)
AttributeError: 'WSGIThreadPoolServer' object has no attribute 'thread_pool'
We prevent this by checking if `self` has a `thread_pool` attribute before trying to reference it.
Fixes issue #5 (https://bitbucket.org/ianb/paste/issue/5/invalid-error-message-when-the-socket-is)
|
| | |\
| | | |
| | | |
| | | | |
replace ``has_key`` method to ``in`` operator #9
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
by wrapping `map` with `list`.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
as suggested by @haypo at https://bitbucket.org/ianb/paste/pull-request/22/fix-improper-commas-in-request-headers-in/diff#comment-6583636
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Revert from using `get` to `getheaders` method.
fixes #4
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
which contains a test for the issue in BB-4, where the WSGI environment has
strings with commas in them that don't belong.
See issue #4.
|
| | |\
| | | |
| | | |
| | | | |
Add HTTP exception for new code 429 "Too Many Requests"
|
| | |
| | |
| | |
| | | |
http://www.ietf.org/id/draft-nottingham-http-new-status-03.txt
|
| | |\
| | | |
| | | |
| | | | |
Escape CGI environment variables in HTTP 404 responses
|
| | | |
|
| |
| |
| |
| |
| | |
because `cgi.parse_qsl` is deprecated, according to
https://docs.python.org/2/library/cgi.html#cgi.parse_qsl
|
| |
|
|\
| |
| |
| | |
Fix error on httpserver shutdown
|
|
|
|
|
|
|
|
|
| |
If a worker thread takes longer than 0.5s to shut down, we try
to kill it. However, if it manages to stop between the 0.5s
timeout and the call to kill_worker, kill_worker will raise
an exception and abort shutdown.
Handle that case with an exception handler.
|
|
See https://www.python.org/dev/peps/pep-0479/
|