[Python-modules-commits] [yarl] 08/16: Import yarl_0.8.1.orig.tar.gz
Piotr Ożarowski
piotr at moszumanska.debian.org
Wed Dec 21 12:00:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
piotr pushed a commit to branch master
in repository yarl.
commit 6865bfe0a98dfd7d8728744eaee4ed065edf6669
Author: Piotr Ożarowski <piotr at debian.org>
Date: Wed Dec 21 12:49:39 2016 +0100
Import yarl_0.8.1.orig.tar.gz
---
CHANGES.rst | 16 +
PKG-INFO | 18 +-
setup.cfg | 2 +-
setup.py | 9 +-
tests/test_quoting.py | 67 +-
tests/test_url.py | 39 +-
yarl.egg-info/PKG-INFO | 18 +-
yarl/__init__.py | 73 +-
yarl/_quoting.c | 2012 ++++++++++++++++++++++++++++++------------------
yarl/_quoting.pyx | 65 +-
yarl/quoting.py | 51 +-
11 files changed, 1540 insertions(+), 830 deletions(-)
diff --git a/CHANGES.rst b/CHANGES.rst
index 2452982..98ec8a2 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,22 @@
CHANGES
=======
+0.8.1 (2016-12-03)
+------------------
+
+* Fix broken aiohttp: revert back `quote` / `unquote`.
+
+
+0.8.0 (2016-12-03)
+------------------
+
+* Support more verbose error messages in `.with_query()` #24
+
+* Don't percent-encode `@` and `:` in path #32
+
+* Don't expose `yarl.quote` and `yarl.unquote`, these functions are
+ part of private API
+
0.7.1 (2016-11-18)
------------------
diff --git a/PKG-INFO b/PKG-INFO
index f00128b..7105d35 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: yarl
-Version: 0.7.1
+Version: 0.8.1
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
@@ -164,6 +164,22 @@ Description: yarl
CHANGES
=======
+ 0.8.1 (2016-12-03)
+ ------------------
+
+ * Fix broken aiohttp: revert back `quote` / `unquote`.
+
+
+ 0.8.0 (2016-12-03)
+ ------------------
+
+ * Support more verbose error messages in `.with_query()` #24
+
+ * Don't percent-encode `@` and `:` in path #32
+
+ * Don't expose `yarl.quote` and `yarl.unquote`, these functions are
+ part of private API
+
0.7.1 (2016-11-18)
------------------
diff --git a/setup.cfg b/setup.cfg
index 57223b6..4882edf 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
test = pytest
[egg_info]
-tag_svn_revision = 0
tag_build =
tag_date = 0
+tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index 5a7b698..dc133d3 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
import pathlib
+import sys
import re
from setuptools import setup, Extension
@@ -58,6 +59,12 @@ with fname.open(encoding='utf8') as fp:
install_requires = ['multidict>=2.0']
+needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
+if needs_pytest:
+ setup_requires = ['pytest-runner']
+else:
+ setup_requires = []
+
def read(name):
fname = here / name
@@ -86,7 +93,7 @@ args = dict(
packages=['yarl'],
install_requires=install_requires,
include_package_data=True,
- setup_requires=['pytest-runner'],
+ setup_requires=setup_requires,
tests_require=['pytest'],
ext_modules=extensions,
cmdclass=dict(build_ext=ve_build_ext))
diff --git a/tests/test_quoting.py b/tests/test_quoting.py
index 7ff946c..052d3fb 100644
--- a/tests/test_quoting.py
+++ b/tests/test_quoting.py
@@ -49,7 +49,7 @@ def test_never_quote(quote):
"0123456789",
"_.-"])
assert quote(do_not_quote) == do_not_quote
- quote(do_not_quote, plus=True) == do_not_quote
+ quote(do_not_quote, qs=True) == do_not_quote
def test_safe(quote):
@@ -57,7 +57,7 @@ def test_safe(quote):
quote_by_default = "<>"
assert quote(quote_by_default, safe=quote_by_default) == quote_by_default
- ret = quote(quote_by_default, safe=quote_by_default, plus=True)
+ ret = quote(quote_by_default, safe=quote_by_default, qs=True)
assert ret == quote_by_default
@@ -73,7 +73,7 @@ def test_default_quoting(char, quote):
# space (separate test for that).
result = quote(char)
assert hexescape(char) == result
- result = quote(char, plus=True)
+ result = quote(char, qs=True)
assert hexescape(char) == result
@@ -81,7 +81,7 @@ def test_default_quoting(char, quote):
def test_default_quoting_percent(quote):
result = quote('%25')
assert '%25' == result
- result = quote('%25', plus=True)
+ result = quote('%25', qs=True)
assert '%25' == result
@@ -90,7 +90,7 @@ def test_default_quoting_partial(quote):
expected = "ab%5B%5Dcd"
result = quote(partial_quote)
assert expected == result
- result = quote(partial_quote, plus=True)
+ result = quote(partial_quote, qs=True)
assert expected == result
@@ -99,7 +99,7 @@ def test_quoting_space(quote):
# their unique way
result = quote(' ')
assert result == hexescape(' ')
- result = quote(' ', plus=True)
+ result = quote(' ', qs=True)
assert result == '+'
given = "a b cd e f"
@@ -107,13 +107,13 @@ def test_quoting_space(quote):
result = quote(given)
assert expect == result
expect = given.replace(' ', '+')
- result = quote(given, plus=True)
+ result = quote(given, qs=True)
assert expect == result
def test_quoting_plus(quote):
- assert quote('alpha+beta gamma', plus=True) == 'alpha%2Bbeta+gamma'
- assert quote('alpha+beta gamma', safe='+', plus=True) == 'alpha+beta+gamma'
+ assert quote('alpha+beta gamma', qs=True) == 'alpha%2Bbeta+gamma'
+ assert quote('alpha+beta gamma', safe='+', qs=True) == 'alpha+beta+gamma'
def test_quote_with_unicode(quote):
@@ -133,12 +133,12 @@ def test_quote_plus_with_unicode(quote):
# Characters in Latin-1 range, encoded by default in UTF-8
given = "\xa2\xd8ab\xff"
expect = "%C2%A2%C3%98ab%C3%BF"
- result = quote(given, plus=True)
+ result = quote(given, qs=True)
assert expect == result
# Characters in BMP, encoded by default in UTF-8
given = "\u6f22\u5b57" # "Kanji"
expect = "%E6%BC%A2%E5%AD%97"
- result = quote(given, plus=True)
+ result = quote(given, qs=True)
assert expect == result
@@ -149,8 +149,9 @@ def test_unquoting(num, unquote):
expect = chr(num)
result = unquote(given)
assert expect == result
- result = unquote(given, plus=True)
- assert expect == result
+ if expect not in '+=&':
+ result = unquote(given, qs=True)
+ assert expect == result
@pytest.mark.xfail
@@ -194,7 +195,7 @@ def test_unquoting_parts(unquote):
expect = "abcd"
result = unquote(given)
assert expect == result
- result = unquote(given, plus=True)
+ result = unquote(given, qs=True)
assert expect == result
@@ -233,11 +234,19 @@ def test_quote_unquoted(quote):
def test_unquote_unsafe(unquote):
- assert unquote('%26', unsafe='&') == '%26'
+ assert unquote('%40', unsafe='@') == '%40'
def test_unquote_unsafe2(unquote):
- assert unquote('%26abc', unsafe='&') == '%26abc'
+ assert unquote('%40abc', unsafe='@') == '%40abc'
+
+
+def test_unquote_unsafe3(unquote):
+ assert unquote('a%2Bb=?%3D%2B%26', qs=True) == 'a%2Bb=?%3D%2B%26'
+
+
+def test_unquote_unsafe4(unquote):
+ assert unquote('a at b', unsafe='@') == 'a%40b'
def test_unquote_non_ascii(unquote):
@@ -266,3 +275,29 @@ def test_quote_str_like(quote):
def test_unquote_str_like(unquote):
assert unquote(StrLike('abc')) == 'abc'
+
+
+def test_quote_sub_delims(quote):
+ assert quote("!$&'()*+,;=") == "!$&'()*+,;="
+
+
+def test_requote_sub_delims(quote):
+ assert quote("%21%24%26%27%28%29%2A%2B%2C%3B%3D") == "!$&'()*+,;="
+
+
+def test_unquote_plus_to_space(unquote):
+ assert unquote('a+b', qs=True) == 'a b'
+
+
+def test_unquote_plus_to_space_unsafe(unquote):
+ assert unquote('a+b', unsafe='+', qs=True) == 'a+b'
+
+
+def test_qoute_qs_with_colon(quote):
+ s = quote('next=http%3A//example.com/', safe='=+&?/:@', qs=True)
+ assert s == 'next=http://example.com/'
+
+
+def test_quote_protected(quote):
+ s = quote('/path%2fto/three', protected='/')
+ assert s == '/path%2Fto/three'
diff --git a/tests/test_url.py b/tests/test_url.py
index f6c42a3..fcd59cf 100644
--- a/tests/test_url.py
+++ b/tests/test_url.py
@@ -155,6 +155,11 @@ def test_raw_path_for_empty_url():
assert '' == url.raw_path
+def test_raw_path_for_colon_and_at():
+ url = URL('http://example.com/path:abc@123')
+ assert url.raw_path == '/path:abc at 123'
+
+
def test_raw_query_string():
url = URL('http://example.com?a=1&b=2')
assert url.raw_query_string == 'a=1&b=2'
@@ -172,7 +177,7 @@ def test_query_string_non_ascii():
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'
+ assert url.query_string == 'a b=c d&e=f g'
def test_query_spaces():
@@ -216,6 +221,11 @@ def test_raw_fragment_non_ascii():
assert '%D1%8F%D0%BA%D0%BE%D1%80%D1%8C' == url.raw_fragment
+def test_raw_fragment_safe():
+ url = URL('http://example.com/path#a?b/c:d@e')
+ assert 'a?b/c:d at e' == url.raw_fragment
+
+
def test_fragment_non_ascii():
url = URL('http://example.com/path#якорь')
assert 'якорь' == url.fragment
@@ -429,6 +439,11 @@ def test_div_non_ascii():
assert url2.raw_parts == ('/', 'path', '%D1%81%D1%8E%D0%B4%D0%B0')
+def test_div_with_colon_and_at():
+ url = URL('http://example.com/base') / 'path:abc at 123'
+ assert url.raw_path == '/base/path:abc at 123'
+
+
# comparison and hashing
def test_ne_str():
@@ -719,7 +734,7 @@ def test_with_query_str_non_ascii_and_spaces():
url = URL('http://example.com')
url2 = url.with_query('a=1 2&b=знач')
assert url2.raw_query_string == 'a=1+2&b=%D0%B7%D0%BD%D0%B0%D1%87'
- assert url2.query_string == 'a=1+2&b=знач'
+ assert url2.query_string == 'a=1 2&b=знач'
def test_with_query_int():
@@ -748,8 +763,8 @@ def test_with_multidict_with_spaces_and_non_ascii():
def test_with_query_multidict_with_unsafe():
url = URL('http://example.com/path')
url2 = url.with_query({'a+b': '?=+&'})
- assert url2.raw_query_string == 'a%2Bb=%3F%3D%2B%26'
- assert url2.query_string == 'a%2Bb=%3F%3D%2B%26'
+ assert url2.raw_query_string == 'a%2Bb=?%3D%2B%26'
+ assert url2.query_string == 'a%2Bb=?%3D%2B%26'
assert url2.query == {'a+b': '?=+&'}
@@ -787,6 +802,12 @@ def test_with_fragment():
assert str(url.with_fragment('frag')) == 'http://example.com/#frag'
+def test_with_fragment_safe():
+ url = URL('http://example.com')
+ u2 = url.with_fragment('a:b?c at d/e')
+ assert str(u2) == 'http://example.com/#a:b?c@d/e'
+
+
def test_with_fragment_non_ascii():
url = URL('http://example.com')
url2 = url.with_fragment('фрагм')
@@ -866,6 +887,10 @@ def test_with_name_non_str():
URL('http://example.com').with_name(123)
+def test_with_name_within_colon_and_at():
+ url = URL('http://example.com/oldpath').with_name('path:abc at 123')
+ assert url.raw_path == '/path:abc at 123'
+
# is_absolute
@@ -1269,3 +1294,9 @@ def test_slash_and_question_in_query():
def test_slash_and_question_in_fragment():
u = URL('http://example.com/path#http://example.com/p?a')
assert u.fragment == 'http://example.com/p?a'
+
+
+def test_requoting():
+ u = URL('http://127.0.0.1/?next=http%3A//example.com/')
+ assert u.raw_query_string == 'next=http://example.com/'
+ assert str(u) == 'http://127.0.0.1/?next=http://example.com/'
diff --git a/yarl.egg-info/PKG-INFO b/yarl.egg-info/PKG-INFO
index f00128b..7105d35 100644
--- a/yarl.egg-info/PKG-INFO
+++ b/yarl.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: yarl
-Version: 0.7.1
+Version: 0.8.1
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
@@ -164,6 +164,22 @@ Description: yarl
CHANGES
=======
+ 0.8.1 (2016-12-03)
+ ------------------
+
+ * Fix broken aiohttp: revert back `quote` / `unquote`.
+
+
+ 0.8.0 (2016-12-03)
+ ------------------
+
+ * Support more verbose error messages in `.with_query()` #24
+
+ * Don't percent-encode `@` and `:` in path #32
+
+ * Don't expose `yarl.quote` and `yarl.unquote`, these functions are
+ part of private API
+
0.7.1 (2016-11-18)
------------------
diff --git a/yarl/__init__.py b/yarl/__init__.py
index 196dee1..845058e 100644
--- a/yarl/__init__.py
+++ b/yarl/__init__.py
@@ -9,9 +9,9 @@ from multidict import MultiDict, MultiDictProxy
from .quoting import quote, unquote
-__version__ = '0.7.1'
+__version__ = '0.8.1'
-__all__ = ['URL', 'quote', 'unquote']
+__all__ = ['URL']
# is_leaf()
@@ -28,6 +28,9 @@ DEFAULT_PORTS = {
sentinel = object()
+_quote = quote
+_unquote = unquote
+
class cached_property:
"""Use as a class method decorator. It operates almost exactly like
@@ -172,16 +175,17 @@ class URL:
if val.port:
netloc += ':{}'.format(val.port)
if val.username:
- user = quote(val.username)
+ user = _quote(val.username)
if val.password:
- user += ':' + quote(val.password)
+ user += ':' + _quote(val.password)
netloc = user + '@' + netloc
val = SplitResult(val[0], # scheme
netloc,
- quote(val[2], safe='/'),
- query=quote(val[3], safe='=+&?', plus=True),
- fragment=quote(val[4]))
+ _quote(val[2], safe='@:', protected='/'),
+ query=_quote(val[3], safe='=+&?/:@',
+ protected='=+&', qs=True),
+ fragment=_quote(val[4], safe='?/:@'))
self._val = val
self._cache = {}
@@ -227,7 +231,7 @@ class URL:
return self._val > other._val
def __truediv__(self, name):
- name = quote(name, safe='/')
+ name = _quote(name, safe=':@', protected='/')
if name.startswith('/'):
raise ValueError("Appending path "
"starting from slash is forbidden")
@@ -294,7 +298,7 @@ class URL:
val = self._val._replace(scheme='', netloc='')
return URL(val, encoded=True)
- @cached_property
+ @property
def scheme(self):
"""Scheme for absolute URLs.
@@ -303,7 +307,7 @@ class URL:
"""
return self._val.scheme
- @cached_property
+ @property
def raw_user(self):
"""Encoded user part of URL.
@@ -320,9 +324,9 @@ class URL:
None if user is missing.
"""
- return unquote(self.raw_user)
+ return _unquote(self.raw_user)
- @cached_property
+ @property
def raw_password(self):
"""Encoded password part of URL.
@@ -338,9 +342,9 @@ class URL:
None if password is missing.
"""
- return unquote(self.raw_password)
+ return _unquote(self.raw_password)
- @cached_property
+ @property
def raw_host(self):
"""Encoded host part of URL.
@@ -363,7 +367,7 @@ class URL:
return None
return raw.encode('ascii').decode('idna')
- @cached_property
+ @property
def port(self):
"""Port part of URL.
@@ -373,7 +377,7 @@ class URL:
"""
return self._val.port or DEFAULT_PORTS.get(self._val.scheme)
- @cached_property
+ @property
def raw_path(self):
"""Encoded path of URL.
@@ -392,7 +396,7 @@ class URL:
/ for absolute URLs without path part.
"""
- return unquote(self.raw_path)
+ return _unquote(self.raw_path)
@cached_property
def query(self):
@@ -405,7 +409,7 @@ class URL:
ret = MultiDict(parse_qsl(self.query_string, keep_blank_values=True))
return MultiDictProxy(ret)
- @cached_property
+ @property
def raw_query_string(self):
"""Encoded query part of URL.
@@ -421,9 +425,9 @@ class URL:
Empty string if query is missing.
"""
- return unquote(self.raw_query_string, unsafe='?&=+')
+ return _unquote(self.raw_query_string, qs=True)
- @cached_property
+ @property
def raw_fragment(self):
"""Encoded fragment part of URL.
@@ -439,7 +443,7 @@ class URL:
Empty string if fragment is missing.
"""
- return unquote(self.raw_fragment)
+ return _unquote(self.raw_fragment)
@cached_property
def raw_parts(self):
@@ -468,7 +472,7 @@ class URL:
('/',) for absolute URLs if *path* is missing.
"""
- return tuple(unquote(part) for part in self.raw_parts)
+ return tuple(_unquote(part) for part in self.raw_parts)
@cached_property
def parent(self):
@@ -503,7 +507,7 @@ class URL:
@cached_property
def name(self):
"""The last part of parts."""
- return unquote(self.raw_name)
+ return _unquote(self.raw_name)
@classmethod
def _make_netloc(cls, user, password, host, port):
@@ -542,7 +546,7 @@ class URL:
if user is None:
password = None
elif isinstance(user, str):
- user = quote(user)
+ user = _quote(user)
password = val.password
else:
raise TypeError("Invalid user type")
@@ -569,7 +573,7 @@ class URL:
if password is None:
pass
elif isinstance(password, str):
- password = quote(password)
+ password = _quote(password)
else:
raise TypeError("Invalid password type")
if not self.is_absolute():
@@ -662,7 +666,7 @@ class URL:
if query is None:
query = ''
elif isinstance(query, Mapping):
- quoter = partial(quote, safe='', plus=True)
+ quoter = partial(_quote, safe='/?:@', qs=True)
lst = []
for k, v in query.items():
if isinstance(v, str):
@@ -670,19 +674,22 @@ class URL:
elif type(v) == int: # no subclasses like bool
v = str(v)
else:
- raise TypeError("Invalid variable type")
+ raise TypeError("Invalid variable type: mapping value "
+ "should be str or int, got {!r}".format(v))
lst.append(quoter(k)+'='+quoter(v))
query = '&'.join(lst)
elif isinstance(query, str):
- query = quote(query, safe='=+&', plus=True)
+ query = _quote(query, safe='/?:@', protected='=&+', qs=True)
elif isinstance(query, (bytes, bytearray, memoryview)):
- raise TypeError("Invalid query type")
+ raise TypeError("Invalid query type: bytes, bytearray and "
+ "memoryview are forbidden")
elif isinstance(query, Sequence):
- quoter = partial(quote, safe='', plus=True)
+ quoter = partial(_quote, safe='/?:@', qs=True)
query = '&'.join(quoter(k)+'='+quoter(v)
for k, v in query)
else:
- raise TypeError("Invalid query type")
+ raise TypeError("Invalid query type: only str, mapping or "
+ "sequence of (str, str) pairs is allowed")
path = self._val.path
if path == '':
path = '/'
@@ -702,7 +709,7 @@ class URL:
fragment = ''
elif not isinstance(fragment, str):
raise TypeError("Invalid fragment type")
- return URL(self._val._replace(fragment=quote(fragment)),
+ return URL(self._val._replace(fragment=_quote(fragment, safe='?/:@')),
encoded=True)
def with_name(self, name):
@@ -718,7 +725,7 @@ class URL:
raise TypeError("Invalid name type")
if '/' in name:
raise ValueError("Slash in name is not allowed")
- name = quote(name, safe='/')
+ name = _quote(name, safe='@:', protected='/')
parts = list(self.raw_parts)
if self.is_absolute():
if len(parts) == 1:
diff --git a/yarl/_quoting.c b/yarl/_quoting.c
index dbec3b5..57f3c31 100644
--- a/yarl/_quoting.c
+++ b/yarl/_quoting.c
@@ -631,17 +631,17 @@ static const char *__pyx_f[] = {
/*--- Type declarations ---*/
struct __pyx_opt_args_4yarl_8_quoting__do_unquote;
-/* "yarl/_quoting.pyx":133
+/* "yarl/_quoting.pyx":142
*
*
- * cdef str _do_unquote(str val, str unsafe='', bint plus=False): # <<<<<<<<<<<<<<
+ * cdef str _do_unquote(str val, str unsafe='', bint qs=False): # <<<<<<<<<<<<<<
* cdef str pct = ''
* cdef str last_pct = ''
*/
struct __pyx_opt_args_4yarl_8_quoting__do_unquote {
int __pyx_n;
PyObject *unsafe;
- int plus;
+ int qs;
};
/* --- Runtime support code (head) --- */
@@ -895,6 +895,31 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeAsUCS4.proto */
+static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
+
+/* object_ord.proto */
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyObject_Ord(c)\
+ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
+#else
+#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
+#endif
+static long __Pyx__PyObject_Ord(PyObject* c);
+
+/* PyObjectCallNoArg.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+/* SliceObject.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
+ int has_cstart, int has_cstop, int wraparound);
+
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
@@ -931,13 +956,13 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
/* PyUCS4InUnicode.proto */
static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character);
static CYTHON_INLINE int __Pyx_PyUnicodeBufferContainsUCS4(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
@@ -955,37 +980,44 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
/* Module declarations from 'yarl._quoting' */
static PyObject *__pyx_v_4yarl_8_quoting_GEN_DELIMS = 0;
+static PyObject *__pyx_v_4yarl_8_quoting_SUB_DELIMS_WITHOUT_QS = 0;
static PyObject *__pyx_v_4yarl_8_quoting_SUB_DELIMS = 0;
static PyObject *__pyx_v_4yarl_8_quoting_RESERVED = 0;
static PyObject *__pyx_v_4yarl_8_quoting_UNRESERVED = 0;
-static PyObject *__pyx_v_4yarl_8_quoting_PCT_ALLOWED = 0;
-static PyObject *__pyx_v_4yarl_8_quoting_UNRESERVED_QUOTED = 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 *, 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"
int __pyx_module_is_main_yarl___quoting = 0;
/* Implementation of 'yarl._quoting' */
-static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_UnicodeDecodeError;
+static PyObject *__pyx_builtin_hex;
static const char __pyx_k_[] = "";
-static const char __pyx_k__4[] = "%";
-static const char __pyx_k__5[] = ":/?#[]@";
-static const char __pyx_k__6[] = "!$&'()*+,;=";
-static const char __pyx_k__7[] = "-._~";
-static const char __pyx_k_02X[] = "%{:02X}";
+static const char __pyx_k__3[] = "+&=";
+static const char __pyx_k__5[] = "+=&";
+static const char __pyx_k__6[] = "%";
+static const char __pyx_k__7[] = "+";
+static const char __pyx_k__8[] = " ";
+static const char __pyx_k_qs[] = "qs";
+static const char __pyx_k__10[] = ":/?#[]@";
+static const char __pyx_k__11[] = "!$'()*,;";
+static const char __pyx_k__12[] = "+?=";
+static const char __pyx_k__13[] = "-._~";
+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_plus[] = "plus";
static const char __pyx_k_safe[] = "safe";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_quote[] = "_quote";
static const char __pyx_k_range[] = "range";
+static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_digits[] = "digits";
static const char __pyx_k_format[] = "format";
@@ -994,6 +1026,7 @@ 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_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";
@@ -1002,25 +1035,31 @@ static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
static const char __pyx_k_Argument_should_be_str[] = "Argument should be str";
static const char __pyx_k_home_travis_build_aio_libs_yarl[] = "/home/travis/build/aio-libs/yarl/yarl/_quoting.pyx";
static PyObject *__pyx_kp_u_;
-static PyObject *__pyx_kp_u_02X;
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_n_s_UnicodeDecodeError;
static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_kp_u__4;
+static PyObject *__pyx_kp_u__10;
+static PyObject *__pyx_kp_u__11;
+static PyObject *__pyx_kp_u__12;
+static PyObject *__pyx_kp_u__13;
+static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__7;
+static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_ascii_letters;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_digits;
static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_kp_s_home_travis_build_aio_libs_yarl;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_plus;
+static PyObject *__pyx_n_s_protected;
+static PyObject *__pyx_n_s_qs;
static PyObject *__pyx_n_s_quote;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_safe;
@@ -1028,19 +1067,22 @@ static PyObject *__pyx_n_s_string;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_unquote;
static PyObject *__pyx_n_s_unsafe;
+static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_yarl__quoting;
-static PyObject *__pyx_pf_4yarl_8_quoting__quote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_safe, int __pyx_v_plus); /* 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_plus); /* 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); /* 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_int_2;
static PyObject *__pyx_int_16;
+static PyObject *__pyx_slice__9;
static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__8;
-static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_codeobj__9;
-static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_codeobj__15;
+static PyObject *__pyx_codeobj__17;
-/* "yarl/_quoting.pyx":24
+/* "yarl/_quoting.pyx":22
*
*
* cdef inline Py_UCS4 _hex(uint8_t v): # <<<<<<<<<<<<<<
@@ -1054,7 +1096,7 @@ static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t __pyx_v_v) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("_hex", 0);
- /* "yarl/_quoting.pyx":25
+ /* "yarl/_quoting.pyx":23
*
* cdef inline Py_UCS4 _hex(uint8_t v):
* if v < 10: # <<<<<<<<<<<<<<
@@ -1064,7 +1106,7 @@ static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t __pyx_v_v) {
__pyx_t_1 = ((__pyx_v_v < 10) != 0);
if (__pyx_t_1) {
- /* "yarl/_quoting.pyx":26
+ /* "yarl/_quoting.pyx":24
* cdef inline Py_UCS4 _hex(uint8_t v):
* if v < 10:
* return <Py_UCS4>(v+0x30) # ord('0') == 0x30 # <<<<<<<<<<<<<<
@@ -1074,7 +1116,7 @@ static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t __pyx_v_v) {
__pyx_r = ((Py_UCS4)(__pyx_v_v + 0x30));
goto __pyx_L0;
- /* "yarl/_quoting.pyx":25
+ /* "yarl/_quoting.pyx":23
*
* cdef inline Py_UCS4 _hex(uint8_t v):
* if v < 10: # <<<<<<<<<<<<<<
@@ -1083,7 +1125,7 @@ static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t __pyx_v_v) {
*/
}
- /* "yarl/_quoting.pyx":28
+ /* "yarl/_quoting.pyx":26
* return <Py_UCS4>(v+0x30) # ord('0') == 0x30
* else:
* return <Py_UCS4>(v+0x41-10) # ord('A') == 0x41 # <<<<<<<<<<<<<<
@@ -1095,7 +1137,7 @@ static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t __pyx_v_v) {
goto __pyx_L0;
}
- /* "yarl/_quoting.pyx":24
+ /* "yarl/_quoting.pyx":22
*
*
* cdef inline Py_UCS4 _hex(uint8_t v): # <<<<<<<<<<<<<<
@@ -1109,7 +1151,7 @@ static CYTHON_INLINE Py_UCS4 __pyx_f_4yarl_8_quoting__hex(uint8_t __pyx_v_v) {
return __pyx_r;
}
-/* "yarl/_quoting.pyx":31
+/* "yarl/_quoting.pyx":29
*
*
* cdef inline int _from_hex(Py_UCS4 v): # <<<<<<<<<<<<<<
@@ -1124,7 +1166,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
int __pyx_t_2;
__Pyx_RefNannySetupContext("_from_hex", 0);
- /* "yarl/_quoting.pyx":32
+ /* "yarl/_quoting.pyx":30
*
* cdef inline int _from_hex(Py_UCS4 v):
* if '0' <= v <= '9': # <<<<<<<<<<<<<<
@@ -1138,7 +1180,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "yarl/_quoting.pyx":33
+ /* "yarl/_quoting.pyx":31
* cdef inline int _from_hex(Py_UCS4 v):
* if '0' <= v <= '9':
* return <int>(v) - 0x30 # ord('0') == 0x30 # <<<<<<<<<<<<<<
@@ -1148,7 +1190,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
__pyx_r = (((int)__pyx_v_v) - 0x30);
goto __pyx_L0;
- /* "yarl/_quoting.pyx":32
+ /* "yarl/_quoting.pyx":30
*
* cdef inline int _from_hex(Py_UCS4 v):
* if '0' <= v <= '9': # <<<<<<<<<<<<<<
@@ -1157,7 +1199,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
*/
}
- /* "yarl/_quoting.pyx":34
+ /* "yarl/_quoting.pyx":32
* if '0' <= v <= '9':
* return <int>(v) - 0x30 # ord('0') == 0x30
* elif 'A' <= v <= 'F': # <<<<<<<<<<<<<<
@@ -1171,7 +1213,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "yarl/_quoting.pyx":35
+ /* "yarl/_quoting.pyx":33
* return <int>(v) - 0x30 # ord('0') == 0x30
* elif 'A' <= v <= 'F':
* return <int>(v) - 0x41 + 10 # ord('A') == 0x41 # <<<<<<<<<<<<<<
@@ -1181,7 +1223,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
__pyx_r = ((((int)__pyx_v_v) - 0x41) + 10);
goto __pyx_L0;
- /* "yarl/_quoting.pyx":34
+ /* "yarl/_quoting.pyx":32
* if '0' <= v <= '9':
* return <int>(v) - 0x30 # ord('0') == 0x30
* elif 'A' <= v <= 'F': # <<<<<<<<<<<<<<
@@ -1190,7 +1232,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
*/
}
- /* "yarl/_quoting.pyx":36
+ /* "yarl/_quoting.pyx":34
* elif 'A' <= v <= 'F':
* return <int>(v) - 0x41 + 10 # ord('A') == 0x41
* elif 'a' <= v <= 'f': # <<<<<<<<<<<<<<
@@ -1204,7 +1246,7 @@ static CYTHON_INLINE int __pyx_f_4yarl_8_quoting__from_hex(Py_UCS4 __pyx_v_v) {
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "yarl/_quoting.pyx":37
... 3716 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