Compare commits

...

8 Commits

Author SHA1 Message Date
Arthur Goldberg
33a2e5bb1f fix issue where request.args.pop removed parameters inconsistently (#2111) 2021-04-12 19:26:28 +03:00
Adam Hopkins
5930bb67a6 Merge branch '19.12LTS' of github.com:sanic-org/sanic into 19.12LTS 2021-02-16 08:50:47 +02:00
Adam Hopkins
4c360f43fd Merge pull request #2025 from sanic-org/fix-uvloop-1912
Fix uvloop 1912
2021-02-16 08:49:45 +02:00
Adam Hopkins
6387f5ddc9 Bump version 2021-02-16 08:43:03 +02:00
Adam Hopkins
23a0308d40 Merge branch '19.12LTS' into fix-uvloop-1912 2021-02-16 08:36:42 +02:00
Adam Hopkins
a7d563d566 Merge pull request #2027 from ashleysommer/19.12LTS
Fix tox requirement install dependency problems in 19.12LTS
2021-02-16 08:36:14 +02:00
Ashley Sommer
f2d91bd4d2 Fix tox requirement install dependency problems in 19.12LTS
Remove old chardet requirement, add in our hard multidict requirement
2021-02-16 09:58:15 +10:00
Adam Hopkins
8c628c69fb fix uvloop version 2021-02-15 14:23:30 +02:00
5 changed files with 34 additions and 11 deletions

View File

@@ -1 +1 @@
__version__ = "19.12.4"
__version__ = "19.12.5"

View File

@@ -260,9 +260,12 @@ class Request:
:type errors: str
:return: RequestParameters
"""
if not self.parsed_args[
(keep_blank_values, strict_parsing, encoding, errors)
]:
if (
keep_blank_values,
strict_parsing,
encoding,
errors,
) not in self.parsed_args:
if self.query_string:
self.parsed_args[
(keep_blank_values, strict_parsing, encoding, errors)
@@ -328,9 +331,12 @@ class Request:
:type errors: str
:return: list
"""
if not self.parsed_not_grouped_args[
(keep_blank_values, strict_parsing, encoding, errors)
]:
if (
keep_blank_values,
strict_parsing,
encoding,
errors,
) not in self.parsed_not_grouped_args:
if self.query_string:
self.parsed_not_grouped_args[
(keep_blank_values, strict_parsing, encoding, errors)

View File

@@ -5,6 +5,7 @@ import codecs
import os
import re
import sys
from distutils.util import strtobool
from setuptools import setup
@@ -24,6 +25,7 @@ class PyTest(TestCommand):
def run_tests(self):
import shlex
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
@@ -38,7 +40,9 @@ def open_local(paths, mode="r", encoding="utf8"):
with open_local(["sanic", "__version__.py"], encoding="latin1") as fp:
try:
version = re.findall(r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M)[0]
version = re.findall(
r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M
)[0]
except IndexError:
raise RuntimeError("Unable to determine version.")
@@ -68,9 +72,11 @@ setup_kwargs = {
],
}
env_dependency = '; sys_platform != "win32" ' 'and implementation_name == "cpython"'
env_dependency = (
'; sys_platform != "win32" ' 'and implementation_name == "cpython"'
)
ujson = "ujson>=1.35" + env_dependency
uvloop = "uvloop>=0.5.3" + env_dependency
uvloop = "uvloop>=0.5.3,<0.15.0" + env_dependency
requirements = [
"httptools>=0.0.10",

View File

@@ -244,6 +244,17 @@ def test_query_string(app):
assert request.args.getlist("test1") == ["1"]
assert request.args.get("test3", default="My value") == "My value"
def test_popped_stays_popped(app):
@app.route("/")
async def handler(request):
return text("OK")
request, response = app.test_client.get(
"/", params=[("test1", "1")]
)
assert request.args.pop("test1") == ["1"]
assert "test1" not in request.args
@pytest.mark.asyncio
async def test_query_string_asgi(app):

View File

@@ -14,7 +14,7 @@ deps =
pytest-sugar
httpcore==0.3.0
httpx==0.9.3
chardet<=2.3.0
multidict==5.0.0
beautifulsoup4
gunicorn
pytest-benchmark