[Python-modules-commits] [yarl] 01/08: Import yarl_0.15.0.orig.tar.gz
Piotr Ożarowski
piotr at moszumanska.debian.org
Thu Nov 30 13:19:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
piotr pushed a commit to branch master
in repository yarl.
commit cdf0cb6c02f578a77a7b02ac763295ca80e5c7ac
Author: Piotr Ożarowski <piotr at debian.org>
Date: Thu Nov 30 14:10:06 2017 +0100
Import yarl_0.15.0.orig.tar.gz
---
CHANGES.rst | 23 +
MANIFEST.in | 1 +
PKG-INFO | 26 +-
docs/api.rst | 11 +
tests/test_pickle.py | 1 -
tests/test_quoting.py | 39 +-
tests/test_update_query.py | 1 +
tests/test_url.py | 11 +
tests/test_url_update_netloc.py | 7 +
yarl.egg-info/PKG-INFO | 26 +-
yarl/__init__.py | 132 ++-
yarl/__init__.pyi | 15 +-
yarl/_quoting.c | 1974 ++++++++++++++++++---------------------
yarl/_quoting.pyx | 80 +-
yarl/quoting.py | 36 +-
15 files changed, 1164 insertions(+), 1219 deletions(-)
diff --git a/CHANGES.rst b/CHANGES.rst
index b9e52ec..61f2dc6 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,29 @@
CHANGES
=======
+0.15.0 (2017-11-23)
+-------------------
+
+* Add `raw_path_qs` attribute (#137)
+
+0.14.2 (2017-11-14)
+-------------------
+
+* Restore `strict` parameter as no-op in `quote`/`unquote`
+
+0.14.1 (2017-11-13)
+-------------------
+
+* Restore `strict` parameter as no-op for sake of compatibility with
+ aiohttp 2.2
+
+0.14.0 (2017-11-11)
+-------------------
+
+* Drop strict mode (#123)
+
+* Fix `"ValueError: Unallowed PCT %"` when there's a `"%"` in the url (#124)
+
0.13.0 (2017-10-01)
-------------------
diff --git a/MANIFEST.in b/MANIFEST.in
index aef646c..96f5203 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,6 +6,7 @@ graft docs
graft tests
global-exclude *.pyc
global-exclude *.cache
+include yarl/*.c
exclude yarl/_quoting.html
exclude yarl/_quoting.*.so
exclude yarl/_quoting.pyd
diff --git a/PKG-INFO b/PKG-INFO
index 796a1de..824b079 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: yarl
-Version: 0.13.0
+Version: 0.15.0
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: andrew.svetlov at gmail.com
License: Apache 2
+Description-Content-Type: UNKNOWN
Description: yarl
====
@@ -167,6 +168,29 @@ Description: yarl
CHANGES
=======
+ 0.15.0 (2017-11-23)
+ -------------------
+
+ * Add `raw_path_qs` attribute (#137)
+
+ 0.14.2 (2017-11-14)
+ -------------------
+
+ * Restore `strict` parameter as no-op in `quote`/`unquote`
+
+ 0.14.1 (2017-11-13)
+ -------------------
+
+ * Restore `strict` parameter as no-op for sake of compatibility with
+ aiohttp 2.2
+
+ 0.14.0 (2017-11-11)
+ -------------------
+
+ * Drop strict mode (#123)
+
+ * Fix `"ValueError: Unallowed PCT %"` when there's a `"%"` in the url (#124)
+
0.13.0 (2017-10-01)
-------------------
diff --git a/docs/api.rst b/docs/api.rst
index 33f3835..4ecb3c9 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -226,6 +226,17 @@ There are two kinds of properties: *decoded* and *encoded* (with
'/path/to?a1=a&a2=b'
+.. attribute:: URL.raw_path_qs
+
+ Encoded *path* part of URL and query string, ``'/'`` for absolute URLs without *path* part.
+
+ .. doctest::
+
+ >>> URL('http://example.com/путь/сюда?ключ=знач').raw_path_qs
+ '/%D0%BF%D1%83%D1%82%D1%8C/%D1%81%D1%8E%D0%B4%D0%B0?%D0%BA%D0%BB%D1%8E%D1%87=%D0%B7%D0%BD%D0%B0%D1%87'
+
+ .. versionadded:: 0.15
+
.. attribute:: URL.raw_path
Encoded *path* part of URL, ``'/'`` for absolute URLs without *path* part.
diff --git a/tests/test_pickle.py b/tests/test_pickle.py
index c856953..16ce3f2 100644
--- a/tests/test_pickle.py
+++ b/tests/test_pickle.py
@@ -26,4 +26,3 @@ def test_default_style_state():
}))
assert not u._cache
assert u._val == 'test'
- assert u._strict is False
diff --git a/tests/test_quoting.py b/tests/test_quoting.py
index 597e7e4..0762ae9 100644
--- a/tests/test_quoting.py
+++ b/tests/test_quoting.py
@@ -22,36 +22,16 @@ def hexescape(char):
return "%" + hex_repr
-def test_quote_not_allowed(quote):
- with pytest.raises(ValueError):
- quote('%HH')
-
-
def test_quote_not_allowed_non_strict(quote):
- assert quote('%HH', strict=False) == '%25HH'
-
-
-def test_quote_unfinished(quote):
- with pytest.raises(ValueError):
- quote('%F%F')
-
-
-def test_quote_unfinished_tail_percent(quote):
- with pytest.raises(ValueError):
- quote('%')
+ assert quote('%HH') == '%25HH'
def test_quote_unfinished_tail_percent_non_strict(quote):
- assert quote('%', strict=False) == '%25'
-
-
-def test_quote_unfinished_tail(quote):
- with pytest.raises(ValueError):
- quote('%2')
+ assert quote('%') == '%25'
def test_quote_unfinished_tail_non_strict(quote):
- assert quote('%2', strict=False) == '%252'
+ assert quote('%2') == '%252'
def test_quote_from_bytes(quote):
@@ -59,16 +39,9 @@ def test_quote_from_bytes(quote):
assert quote('') == ''
-def test_quate_broken_unicode(quote):
- with pytest.raises(UnicodeEncodeError):
- quote('j\x1a\udcf4q\udcda/\udc97g\udcee\udccb\x0ch\udccb'
- '\x18\udce4v\x1b\udce2\udcce\udccecom/y\udccepj\x16')
-
-
def test_quate_ignore_broken_unicode(quote):
s = quote('j\x1a\udcf4q\udcda/\udc97g\udcee\udccb\x0ch\udccb'
- '\x18\udce4v\x1b\udce2\udcce\udccecom/y\udccepj\x16',
- strict=False)
+ '\x18\udce4v\x1b\udce2\udcce\udccecom/y\udccepj\x16')
assert s == 'j%1Aq%2Fg%0Ch%18v%1Bcom%2Fypj%16'
@@ -271,14 +244,14 @@ def test_quote_unquoted(quote):
def test_quote_space(quote):
- assert quote(' ', strict=False) == '%20' # NULL
+ assert quote(' ') == '%20' # NULL
# test to see if this would work to fix
# coverage on this file.
def test_quote_percent_last_character(quote):
# % is last character in this case.
- assert quote('%', strict=False) == '%25'
+ assert quote('%') == '%25'
def test_unquote_unsafe(unquote):
diff --git a/tests/test_update_query.py b/tests/test_update_query.py
index d7e45ba..7e4ee4d 100644
--- a/tests/test_update_query.py
+++ b/tests/test_update_query.py
@@ -16,6 +16,7 @@ def test_with_query():
def test_update_query():
url = URL('http://example.com/')
assert str(url.update_query({'a': '1'})) == 'http://example.com/?a=1'
+ assert str(URL('test').update_query(a=1)) == 'test?a=1'
url = URL('http://example.com/?foo=bar')
expected_url = URL('http://example.com/?foo=bar&baz=foo')
diff --git a/tests/test_url.py b/tests/test_url.py
index d2582ff..7c4e962 100644
--- a/tests/test_url.py
+++ b/tests/test_url.py
@@ -219,6 +219,17 @@ def test_path_qs():
assert url.path_qs == '/path?б=в&ю=к'
+def test_raw_path_qs():
+ url = URL('http://example.com/')
+ assert url.raw_path_qs == '/'
+ url = URL('http://example.com/?б=в&ю=к')
+ assert url.raw_path_qs == '/?%D0%B1=%D0%B2&%D1%8E=%D0%BA'
+ url = URL('http://example.com/path?б=в&ю=к')
+ assert url.raw_path_qs == '/path?%D0%B1=%D0%B2&%D1%8E=%D0%BA'
+ url = URL('http://example.com/путь?a=1&b=2')
+ assert url.raw_path_qs == '/%D0%BF%D1%83%D1%82%D1%8C?a=1&b=2'
+
+
def test_query_string_spaces():
url = URL('http://example.com?a+b=c+d&e=f+g')
assert url.query_string == 'a b=c d&e=f g'
diff --git a/tests/test_url_update_netloc.py b/tests/test_url_update_netloc.py
index 46bdab0..b160865 100644
--- a/tests/test_url_update_netloc.py
+++ b/tests/test_url_update_netloc.py
@@ -72,6 +72,13 @@ def test_with_password_non_ascii():
assert url2.password == 'пароль'
+def test_with_password_non_ascii_with_colon():
+ url = URL('http://john@example.com')
+ url2 = url.with_password('п:а')
+ assert url2.raw_password == '%D0%BF%3A%D0%B0'
+ assert url2.password == 'п:а'
+
+
def test_with_password_for_relative_url():
with pytest.raises(ValueError):
URL('path/to').with_password('pass')
diff --git a/yarl.egg-info/PKG-INFO b/yarl.egg-info/PKG-INFO
index 796a1de..824b079 100644
--- a/yarl.egg-info/PKG-INFO
+++ b/yarl.egg-info/PKG-INFO
@@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: yarl
-Version: 0.13.0
+Version: 0.15.0
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: andrew.svetlov at gmail.com
License: Apache 2
+Description-Content-Type: UNKNOWN
Description: yarl
====
@@ -167,6 +168,29 @@ Description: yarl
CHANGES
=======
+ 0.15.0 (2017-11-23)
+ -------------------
+
+ * Add `raw_path_qs` attribute (#137)
+
+ 0.14.2 (2017-11-14)
+ -------------------
+
+ * Restore `strict` parameter as no-op in `quote`/`unquote`
+
+ 0.14.1 (2017-11-13)
+ -------------------
+
+ * Restore `strict` parameter as no-op for sake of compatibility with
+ aiohttp 2.2
+
+ 0.14.0 (2017-11-11)
+ -------------------
+
+ * Drop strict mode (#123)
+
+ * Fix `"ValueError: Unallowed PCT %"` when there's a `"%"` in the url (#124)
+
0.13.0 (2017-10-01)
-------------------
diff --git a/yarl/__init__.py b/yarl/__init__.py
index 5b7eae8..6dff9b4 100644
--- a/yarl/__init__.py
+++ b/yarl/__init__.py
@@ -1,3 +1,4 @@
+import warnings
from collections import OrderedDict
from collections.abc import Mapping, Sequence
from functools import partial
@@ -10,7 +11,7 @@ from multidict import MultiDict, MultiDictProxy
from .quoting import quote, unquote
-__version__ = '0.13.0'
+__version__ = '0.15.0'
__all__ = ['URL']
@@ -46,7 +47,7 @@ class cached_property:
self.wrapped = wrapped
try:
self.__doc__ = wrapped.__doc__
- except: # pragma: no cover
+ except AttributeError: # pragma: no cover
self.__doc__ = ""
self.name = wrapped.__name__
@@ -134,13 +135,14 @@ class URL:
# / path-noscheme
# / path-empty
# absolute-URI = scheme ":" hier-part [ "?" query ]
- __slots__ = ('_cache', '_val', '_strict')
+ __slots__ = ('_cache', '_val')
- def __init__(self, val='', *, encoded=False, strict=False):
+ def __init__(self, val='', *, encoded=False, strict=None):
+ if strict is not None: # pragma: no cover
+ warnings.warn("strict parameter is ignored")
if isinstance(val, URL):
self._val = val._val
self._cache = val._cache
- self._strict = val._strict
return
if isinstance(val, str):
val = urlsplit(val)
@@ -150,8 +152,6 @@ class URL:
else:
raise TypeError("Constructor parameter should be str")
- self._strict = strict
-
if not encoded:
if not val[1]: # netloc
netloc = ''
@@ -167,11 +167,11 @@ class URL:
else:
try:
ip = ip_address(netloc)
- except:
+ except ValueError:
pass
else:
if ip.version == 6:
- netloc = '['+netloc+']'
+ netloc = '[' + netloc + ']'
if val.port:
netloc += ':{}'.format(val.port)
if val.username:
@@ -183,13 +183,13 @@ class URL:
if user:
netloc = user + '@' + netloc
- path = _quote(val[2], safe='+@:', protected='/+', strict=strict)
+ path = _quote(val[2], safe='+@:', protected='/+')
if netloc:
path = _normalize_path(path)
query = _quote(val[3], safe='=+&?/:@',
- protected=PROTECT_CHARS, qs=True, strict=strict)
- fragment = _quote(val[4], safe='?/:@', strict=strict)
+ protected=PROTECT_CHARS, qs=True)
+ fragment = _quote(val[4], safe='?/:@')
val = SplitResult(val[0], netloc, path, query, fragment)
self._val = val
@@ -197,7 +197,7 @@ class URL:
@classmethod
def build(cls, *, scheme='', user='', password='', host='', port=None,
- path='', query=None, query_string='', fragment='', strict=False):
+ path='', query=None, query_string='', fragment=''):
"""Creates and returns a new URL"""
if host and not scheme:
@@ -223,7 +223,6 @@ class URL:
_quote(query_string),
fragment
),
- strict=strict,
encoded=True
)
@@ -285,7 +284,7 @@ class URL:
return self._val > other._val
def __truediv__(self, name):
- name = _quote(name, safe=':@', protected='/', strict=self._strict)
+ name = _quote(name, safe=':@', protected='/')
if name.startswith('/'):
raise ValueError("Appending path "
"starting from slash is forbidden")
@@ -304,15 +303,14 @@ class URL:
encoded=True)
def __getstate__(self):
- return self._val, self._strict
+ return self._val,
def __setstate__(self, state):
if state[0] is None and isinstance(state[1], dict):
# default style pickle
self._val = state[1]['_val']
- self._strict = state[1]['_strict']
else:
- self._val, self._strict = state
+ self._val, *unused = state
self._cache = {}
def is_absolute(self):
@@ -501,12 +499,18 @@ class URL:
@cached_property
def path_qs(self):
- """Decoded path of URL with query
- """
+ """Decoded path of URL with query."""
if not self.query_string:
return self.path
return '{}?{}'.format(self.path, self.query_string)
+ @cached_property
+ def raw_path_qs(self):
+ """Encoded path of URL with query."""
+ if not self.raw_query_string:
+ return self.raw_path
+ return '{}?{}'.format(self.raw_path, self.raw_query_string)
+
@property
def raw_fragment(self):
"""Encoded fragment part of URL.
@@ -684,11 +688,11 @@ class URL:
raise ValueError("host removing is not allowed")
try:
ip = ip_address(host)
- except:
+ except ValueError:
host = host.encode('idna').decode('ascii')
else:
if ip.version == 6:
- host = '['+host+']'
+ host = '[' + host + ']'
val = self._val
return URL(
self._val._replace(netloc=self._make_netloc(val.username,
@@ -721,7 +725,7 @@ class URL:
def with_path(self, path, *, encoded=False):
"""Return a new URL with path replaced."""
if not encoded:
- path = _quote(path, safe='@:', protected='/', strict=self._strict)
+ path = _quote(path, safe='@:', protected='/')
if self.is_absolute():
path = _normalize_path(path)
if len(path) > 0 and path[0] != '/':
@@ -729,19 +733,7 @@ class URL:
return URL(self._val._replace(path=path, query='', fragment=''),
encoded=True)
- def with_query(self, *args, **kwargs):
- """Return a new URL with query part replaced.
-
- Accepts any Mapping (e.g. dict, multidict.MultiDict instances)
- or str, autoencode the argument if needed.
-
- It also can take an arbitrary number of keyword arguments.
-
- Clear query if None is passed.
-
- """
- # N.B. doesn't cleanup query/fragment
-
+ def _get_str_query(self, *args, **kwargs):
if kwargs:
if len(args) > 0:
raise ValueError("Either kwargs or single query parameter "
@@ -756,7 +748,7 @@ class URL:
if query is None:
query = ''
elif isinstance(query, Mapping):
- quoter = partial(_quote, qs=True, strict=self._strict)
+ quoter = partial(_quote, qs=True)
lst = []
for k, v in query.items():
if isinstance(v, str):
@@ -766,53 +758,59 @@ class URL:
else:
raise TypeError("Invalid variable type: mapping value "
"should be str or int, got {!r}".format(v))
- lst.append(quoter(k, safe='/?:@')+'='+quoter(v, safe='/?:@'))
+ lst.append(
+ quoter(k, safe='/?:@') + '=' + quoter(v, safe='/?:@'))
query = '&'.join(lst)
elif isinstance(query, str):
query = _quote(query, safe='/?:@',
protected=PROTECT_CHARS,
- qs=True, strict=self._strict)
+ qs=True)
elif isinstance(query, (bytes, bytearray, memoryview)):
raise TypeError("Invalid query type: bytes, bytearray and "
"memoryview are forbidden")
elif isinstance(query, Sequence):
- quoter = partial(_quote, qs=True, strict=self._strict)
- query = '&'.join(quoter(k, safe='/?:@')+'='+quoter(v, safe='/?:@')
+ quoter = partial(_quote, qs=True, safe='/?:@')
+ query = '&'.join(quoter(k) + '=' + quoter(v)
for k, v in query)
else:
raise TypeError("Invalid query type: only str, mapping or "
"sequence of (str, str) pairs is allowed")
+
+ return query
+
+ def with_query(self, *args, **kwargs):
+ """Return a new URL with query part replaced.
+
+ Accepts any Mapping (e.g. dict, multidict.MultiDict instances)
+ or str, autoencode the argument if needed.
+
+ It also can take an arbitrary number of keyword arguments.
+
+ Clear query if None is passed.
+
+ """
+ # N.B. doesn't cleanup query/fragment
+
+ new_query = self._get_str_query(*args, **kwargs)
return URL(
- self._val._replace(path=self._val.path, query=query), encoded=True)
+ self._val._replace(path=self._val.path, query=new_query),
+ encoded=True)
def update_query(self, *args, **kwargs):
"""Return a new URL with query part updated."""
- if kwargs:
- if len(args) > 0:
- raise ValueError("Either kwargs or single query parameter "
- "must be present")
- new_query = kwargs
- elif len(args) == 1:
- new_query = args[0]
-
- if isinstance(new_query, str):
- new_query = OrderedDict(
- map(
- lambda x: x.split('=', 1),
- _quote(new_query,
- safe='/?:@', protected=PROTECT_CHARS,
- qs=True,
- strict=self._strict).lstrip("?").split("&")
- )
- )
-
- else:
- raise ValueError("Either kwargs or single query parameter "
- "must be present")
-
+ new_query = OrderedDict(
+ map(
+ lambda x: x.split('=', 1),
+ _quote(self._get_str_query(*args, **kwargs),
+ safe='/?:@', protected=PROTECT_CHARS,
+ qs=True).lstrip("?").split("&")
+ )
+ )
query = OrderedDict(self.query)
query.update(new_query)
- return self.with_query(tuple(query.items()))
+ query = self._get_str_query(query)
+ return URL(
+ self._val._replace(path=self._val.path, query=query), encoded=True)
def with_fragment(self, fragment):
"""Return a new URL with fragment replaced.
@@ -829,7 +827,7 @@ class URL:
raise TypeError("Invalid fragment type")
return URL(
self._val._replace(
- fragment=_quote(fragment, safe='?/:@', strict=self._strict)),
+ fragment=_quote(fragment, safe='?/:@')),
encoded=True)
def with_name(self, name):
diff --git a/yarl/__init__.pyi b/yarl/__init__.pyi
index dccf0a9..e1a39d3 100644
--- a/yarl/__init__.pyi
+++ b/yarl/__init__.pyi
@@ -16,6 +16,7 @@ class URL:
raw_query_string = ... # type: str
query_string = ... # type: str
path_qs = ... # type: str
+ raw_path_qs = ... # type: str
raw_fragment = ... # type: str
fragment = ... # type: str
query = ... # type: multidict.MultiDict
@@ -44,7 +45,7 @@ class URL:
def __gt__(self, other: Any) -> bool: ...
def __hash__(self) -> int: ...
- def __truediv__(self, str: str) -> URL: ...
+ def __truediv__(self, name: str) -> URL: ...
def is_absolute(self) -> bool: ...
def is_default_port(self) -> bool: ...
@@ -62,20 +63,20 @@ class URL:
@overload
def with_query(self, query: str) -> URL: ...
@overload
- def with_query(self, query: Mapping[str, str]) -> URL: ...
+ def with_query(self, query: Mapping[str, Union[str, int]]) -> URL: ...
@overload
- def with_query(self, query: Sequence[Tuple[str, str]]) -> URL: ...
+ def with_query(self, query: Sequence[Tuple[str, Union[str, int]]]) -> URL: ...
@overload
- def with_query(self, **kwargs: str) -> URL: ...
+ def with_query(self, **kwargs: Union[str, int]) -> URL: ...
@overload
def update_query(self, query: str) -> URL: ...
@overload
- def update_query(self, query: Mapping[str, str]) -> URL: ...
+ def update_query(self, query: Mapping[str, Union[str, int]]) -> URL: ...
@overload
- def update_query(self, query: Sequence[Tuple[str, str]]) -> URL: ...
+ def update_query(self, query: Sequence[Tuple[str, Union[str, int]]]) -> URL: ...
@overload
- def update_query(self, **kwargs: str) -> URL: ...
+ def update_query(self, **kwargs: Union[str, int]) -> URL: ...
def with_fragment(self, fragment: Optional[str]) -> URL: ...
def with_name(self, name: str) -> URL: ...
diff --git a/yarl/_quoting.c b/yarl/_quoting.c
index c0d6d8d..ea0e30f 100644
--- a/yarl/_quoting.c
+++ b/yarl/_quoting.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.27 */
+/* Generated by Cython 0.27.3 */
/* BEGIN: Cython Metadata
{
@@ -20,7 +20,7 @@ END: Cython Metadata */
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
-#define CYTHON_ABI "0_27"
+#define CYTHON_ABI "0_27_3"
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
@@ -181,7 +181,7 @@ END: Cython Metadata */
#define CYTHON_FAST_PYCALL 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
@@ -243,10 +243,10 @@ END: Cython Metadata */
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
#define __Pyx_PyThreadState_Current PyThreadState_GET()
-#elif PY_VERSION_HEX >= 0x03050200
+#elif PY_VERSION_HEX >= 0x03060000
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
- #define __Pyx_PyThreadState_Current PyThreadState_Get()
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
#define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
@@ -460,20 +460,28 @@ END: Cython Metadata */
#include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
- #ifdef __cplusplus
+ #if defined(__cplusplus) && __cplusplus >= 201103L
#if __has_cpp_attribute(fallthrough)
#define CYTHON_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
- #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__))
+ #if __has_attribute(fallthrough)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#else
#define CYTHON_FALLTHROUGH
#endif
#endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
#endif
#ifndef CYTHON_INLINE
@@ -715,7 +723,7 @@ bad:
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime;
@@ -735,7 +743,7 @@ static const char *__pyx_f[] = {
/*--- Type declarations ---*/
struct __pyx_opt_args_4yarl_8_quoting__do_unquote;
-/* "yarl/_quoting.pyx":185
+/* "yarl/_quoting.pyx":181
*
*
* cdef str _do_unquote(str val, str unsafe='', bint qs=False): # <<<<<<<<<<<<<<
@@ -849,6 +857,9 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
__Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
+/* GetModuleGlobalName.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
@@ -859,16 +870,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
-#if PY_VERSION_HEX >= 0x03050000
- #define __Pyx_PyThreadState_assign __pyx_tstate = _PyThreadState_UncheckedGet();
-#elif PY_VERSION_HEX >= 0x03000000
- #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_Get();
-#elif PY_VERSION_HEX >= 0x02070000
- #define __Pyx_PyThreadState_assign __pyx_tstate = _PyThreadState_Current;
-#else
- #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_Get();
-#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
@@ -894,6 +897,8 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
#endif
@@ -909,6 +914,17 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
int wraparound, int boundscheck);
+/* unicode_iter.proto */
+static CYTHON_INLINE int __Pyx_init_unicode_iteration(
+ PyObject* ustring, Py_ssize_t *length, void** data, int *kind);
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
@@ -920,13 +936,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
#endif
#endif
-/* PyCFunctionFastCall.proto */
-#if CYTHON_FAST_PYCCALL
-static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
-#else
-#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
-#endif
-
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
@@ -935,10 +944,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-/* unicode_iter.proto */
-static CYTHON_INLINE int __Pyx_init_unicode_iteration(
- PyObject* ustring, Py_ssize_t *length, void** data, int *kind);
-
/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
@@ -1081,11 +1086,12 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
-/* GetModuleGlobalName.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
-
/* CLineInTraceback.proto */
-static int __Pyx_CLineForTraceback(int c_line);
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
/* CodeObjectCache.proto */
typedef struct {
@@ -1154,33 +1160,34 @@ static PyObject *__pyx_v_4yarl_8_quoting_UNRESERVED = 0;
static PyObject *__pyx_v_4yarl_8_quoting_ALLOWED = 0;
static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t); /*proto*/
static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4); /*proto*/
-static PyObject *__pyx_f_4yarl_8_quoting__do_quote(PyObject *, PyObject *, PyObject *, int, int); /*proto*/
+static PyObject *__pyx_f_4yarl_8_quoting__do_quote(PyObject *, PyObject *, PyObject *, int); /*proto*/
static PyObject *__pyx_f_4yarl_8_quoting__do_unquote(PyObject *, struct __pyx_opt_args_4yarl_8_quoting__do_unquote *__pyx_optional_args); /*proto*/
#define __Pyx_MODULE_NAME "yarl._quoting"
+extern int __pyx_module_is_main_yarl___quoting;
int __pyx_module_is_main_yarl___quoting = 0;
/* Implementation of 'yarl._quoting' */
static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_UnicodeDecodeError;
static PyObject *__pyx_builtin_hex;
static const char __pyx_k_[] = "";
-static const char __pyx_k__3[] = "+&=;";
-static const char __pyx_k__7[] = "+=&;";
-static const char __pyx_k__8[] = "%";
-static const char __pyx_k__9[] = "+";
+static const char __pyx_k__4[] = "+&=;";
+static const char __pyx_k__8[] = "+=&;";
+static const char __pyx_k__9[] = "%";
static const char __pyx_k_qs[] = "qs";
-static const char __pyx_k__10[] = " ";
-static const char __pyx_k__12[] = ":/?#[]@";
-static const char __pyx_k__13[] = "!$'()*,";
-static const char __pyx_k__14[] = "+?=;";
-static const char __pyx_k__15[] = "-._~";
+static const char __pyx_k__10[] = "+";
+static const char __pyx_k__11[] = " ";
+static const char __pyx_k__13[] = ":/?#[]@";
+static const char __pyx_k__14[] = "!$'()*,";
+static const char __pyx_k__15[] = "+?=;";
+static const char __pyx_k__16[] = "-._~";
static const char __pyx_k_hex[] = "hex";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_safe[] = "safe";
static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_quote[] = "_quote";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_utf_8[] = "utf-8";
@@ -1188,40 +1195,33 @@ static const char __pyx_k_append[] = "append";
static const char __pyx_k_digits[] = "digits";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_errors[] = "errors";
-static const char __pyx_k_format[] = "format";
static const char __pyx_k_ignore[] = "ignore";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_strict[] = "strict";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_unsafe[] = "unsafe";
static const char __pyx_k_unquote[] = "_unquote";
+static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_protected[] = "protected";
-static const char __pyx_k_ValueError[] = "ValueError";
-static const char __pyx_k_Unallowed_PCT[] = "Unallowed PCT %{}{}";
static const char __pyx_k_ascii_letters[] = "ascii_letters";
static const char __pyx_k_yarl__quoting[] = "yarl._quoting";
-static const char __pyx_k_Unallowed_PCT_2[] = "Unallowed PCT %{}";
-static const char __pyx_k_Unallowed_PCT_3[] = "Unallowed PCT %";
static const char __pyx_k_yarl__quoting_pyx[] = "yarl/_quoting.pyx";
static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_Argument_should_be_str[] = "Argument should be str";
+static const char __pyx_k_strict_parameter_is_ignored[] = "strict parameter is ignored";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_kp_u_Argument_should_be_str;
static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_kp_u_Unallowed_PCT;
-static PyObject *__pyx_kp_u_Unallowed_PCT_2;
-static PyObject *__pyx_kp_u_Unallowed_PCT_3;
static PyObject *__pyx_n_s_UnicodeDecodeError;
-static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u__10;
-static PyObject *__pyx_kp_u__12;
+static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_u__13;
static PyObject *__pyx_kp_u__14;
static PyObject *__pyx_kp_u__15;
-static PyObject *__pyx_kp_u__3;
-static PyObject *__pyx_kp_u__7;
+static PyObject *__pyx_kp_u__16;
+static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_kp_u__9;
static PyObject *__pyx_n_s_append;
@@ -1231,7 +1231,6 @@ static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_digits;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_errors;
-static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_n_u_ignore;
static PyObject *__pyx_n_s_import;
@@ -1241,7 +1240,7 @@ static PyObject *__pyx_n_s_qs;
static PyObject *__pyx_n_s_quote;
static PyObject *__pyx_n_s_safe;
static PyObject *__pyx_n_s_strict;
-static PyObject *__pyx_n_u_strict;
+static PyObject *__pyx_kp_u_strict_parameter_is_ignored;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_unquote;
@@ -1249,23 +1248,26 @@ static PyObject *__pyx_n_s_unsafe;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_kp_u_utf_8;
static PyObject *__pyx_n_s_val;
+static PyObject *__pyx_n_s_warn;
+static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_yarl__quoting;
static PyObject *__pyx_kp_s_yarl__quoting_pyx;
-static PyObject *__pyx_pf_4yarl_8_quoting__quote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_safe, PyObject *__pyx_v_protected, int __pyx_v_qs, int __pyx_v_strict); /* proto */
-static PyObject *__pyx_pf_4yarl_8_quoting_2_unquote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_unsafe, PyObject *__pyx_v_qs); /* proto */
+static PyObject *__pyx_pf_4yarl_8_quoting__quote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_safe, PyObject *__pyx_v_protected, int __pyx_v_qs, PyObject *__pyx_v_strict); /* proto */
+static PyObject *__pyx_pf_4yarl_8_quoting_2_unquote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_unsafe, PyObject *__pyx_v_qs, PyObject *__pyx_v_strict); /* proto */
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_16;
static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
-static PyObject *__pyx_slice__11;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_codeobj__17;
-static PyObject *__pyx_codeobj__19;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_slice__12;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__19;
... 4246 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/yarl.git
More information about the Python-modules-commits
mailing list